import jagex.DataOperations;
import jagex.client.Camera;
import jagex.client.GameImage;
import jagex.client.GameWindowMiddleMan;
import jagex.client.Menu;
import jagex.client.Model;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.io.IOException;

public class mudclient extends GameWindowMiddleMan {

	public static void main(String arg0[]) {
		mudclient mc = new mudclient();
		mc.appletMode = false;
		mc.createWindow(mc.windowWidth, mc.windowHeight + 22, "Runescape by Andrew Gower", false);
		mc.threadSleepTime = 10;
	}

	private Mob lastPlayerArray[];
	private int lastPlayerCount;
	private boolean hasWorldInfo;
	private Mob lastNpcArray[];
	private int lastNpcCount;

	protected void startGameClient() {
		super.port = 43594;
		super.yOffset = -11;
		GameWindowMiddleMan.vc = 500;
		GameWindowMiddleMan.uc = false;
		GameWindowMiddleMan.xc = 6;
		loadConfiguration();
		az = 2000;
		zy = az + 100;
		nw = zy + 50;
		vz = nw + 300;
		ot = getGraphics();
		lj(50);
		gameGraphics = new GameImageMiddleMan(windowWidth, windowHeight + 12, 2600, this);
		gameGraphics._mudclient = this;
		gameGraphics.setDimensions(0, 0, windowWidth, windowHeight + 12);
		Menu.dg = false;
		Menu.eg = zy;
		ecb = new Menu(gameGraphics, 5);
		int i1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
		byte byte0 = 36;
		fcb = ecb.nc(i1, byte0 + 24, 196, 90, 1, 500, true);
		hcb = new Menu(gameGraphics, 5);
		icb = hcb.nc(i1, byte0 + 40, 196, 126, 1, 500, true);
		loadMedia();
		loadEntities(true);
		gameCamera = new Camera(gameGraphics, 15000, 15000, 1000);
		gameCamera.setCameraSize(windowWidth / 2, windowHeight / 2, windowWidth / 2, windowHeight / 2, windowWidth, du);
		gameCamera.zoom1 = 2400;
		gameCamera.zoom2 = 2400;
		gameCamera.zoom3 = 1;
		gameCamera.zoom4 = 2300;
		gameCamera.xh(-50, -10, -50);
		terrain = new Terrain(gameCamera, gameGraphics);
		terrain.ydb = az;
		loadTextures();
		loadModels();
		loadLandscape();
		drawProgressBar(100, "Starting game...");
		drawGameMenu();
		drawLoginMenu();
		drawCharacterDesignMenu();
		resetLoginVars();
		sj();
	}

	public void loadConfiguration() {
		if (qj()) {
			byte abyte0[] = null;
			try {
				abyte0 = updareProgressBar("config" + Versions.confVersion + ".jag",
						"Configuration", 10);

			} catch (IOException ioexception) {
			}
			Cache.oo(abyte0);
			return;
		} else {
			drawLoadingScreen(10, "Loading configuration");
			Cache.loadGameCache();
			return;
		}
	}

	public void loadMedia() {
		if (qj()) {
			byte abyte0[] = null;
			try {
				abyte0 = updareProgressBar("media" + Versions.mediaVersion + ".jag", "2d graphics", 20);
			} catch (IOException ioexception) {
			}

			gameGraphics.eg(abyte0, DataOperations.mm("inv1.tga", abyte0), az,
					true, false);
			gameGraphics.cg(abyte0, DataOperations.mm("inv2.tga", abyte0),
					az + 1, true, 1, 6, false);
			gameGraphics.eg(abyte0, DataOperations.mm("bubble.tga", abyte0),
					az + 9, true, false);
			gameGraphics.eg(abyte0, DataOperations.mm("runescape.tga", abyte0),
					az + 10, true, false);
			gameGraphics.jg(abyte0, DataOperations.mm("splat.tga", abyte0),
					az + 11, true, 3, false);
			gameGraphics.cg(abyte0, DataOperations.mm("icon.tga", abyte0),
					az + 14, true, 4, 2, false);
			gameGraphics.eg(abyte0, DataOperations.mm("hbar.tga", abyte0),
					az + 22, false, false);
			gameGraphics.eg(abyte0, DataOperations.mm("hbar2.tga", abyte0),
					az + 23, true, false);
			gameGraphics.eg(abyte0, DataOperations.mm("compass.tga", abyte0),
					az + 24, true, false);
			gameGraphics.jg(abyte0, DataOperations.mm("scrollbar.tga", abyte0),
					zy, true, 2, false);
			gameGraphics.jg(abyte0, DataOperations.mm("corners.tga", abyte0),
					zy + 2, true, 4, false);
			gameGraphics.jg(abyte0, DataOperations.mm("arrows.tga", abyte0),
					zy + 6, true, 2, false);
			rt = bj(DataOperations.lm("hbar.tga", 0, abyte0));
			int i1 = Cache.ufb;
			for (int k1 = 1; i1 > 0; k1++) {
				int i2 = i1;
				i1 -= 30;
				if (i2 > 30) {
					i2 = 30;
				}
				gameGraphics
						.cg(abyte0, DataOperations.mm("objects" + k1 + ".tga",
								abyte0), nw + (k1 - 1) * 30, true, 10,
								(i2 + 9) / 10, false);
			}

			gameGraphics.jg(abyte0,
					DataOperations.mm("projectile.tga", abyte0), vz, true,
					Cache.hjb, false);
			return;
		}
		byte abyte1[] = new byte[0x186a0];
		drawProgressBar(20, "Loading 2d graphics");
		try {
			DataOperations.readFromPath("../gamedata/media/inv1.tga", abyte1, 0x186a0);
			gameGraphics.eg(abyte1, 0, az, true, false);
			DataOperations.readFromPath("../gamedata/media/inv2.tga", abyte1, 0x186a0);
			gameGraphics.cg(abyte1, 0, az + 1, true, 1, 6, false);
			DataOperations.readFromPath("../gamedata/media/bubble.tga", abyte1, 0x186a0);
			gameGraphics.eg(abyte1, 0, az + 9, true, false);
			DataOperations.readFromPath("../gamedata/media/runescape.tga",
					abyte1, 0x186a0);
			gameGraphics.eg(abyte1, 0, az + 10, true, false);
			DataOperations.readFromPath("../gamedata/media/splat.tga", abyte1,
					0x186a0);
			gameGraphics.jg(abyte1, 0, az + 11, true, 3, false);
			DataOperations.readFromPath("../gamedata/media/icon.tga", abyte1,
					0x186a0);
			gameGraphics.cg(abyte1, 0, az + 14, true, 4, 2, false);
			DataOperations.readFromPath("../gamedata/media/hbar.tga", abyte1,
					0x186a0);
			gameGraphics.eg(abyte1, 0, az + 22, false, false);
			rt = bj(abyte1);
			DataOperations.readFromPath("../gamedata/media/hbar2.tga", abyte1,
					0x186a0);
			gameGraphics.eg(abyte1, 0, az + 23, true, false);
			DataOperations.readFromPath("../gamedata/media/compass.tga",
					abyte1, 0x186a0);
			gameGraphics.eg(abyte1, 0, az + 24, true, false);
			DataOperations.readFromPath("../gamedata/media/scrollbar.tga",
					abyte1, 0x186a0);
			gameGraphics.jg(abyte1, 0, zy, true, 2, false);
			DataOperations.readFromPath("../gamedata/media/corners.tga",
					abyte1, 0x186a0);
			gameGraphics.jg(abyte1, 0, zy + 2, true, 4, false);
			DataOperations.readFromPath("../gamedata/media/arrows.tga", abyte1,
					0x186a0);
			gameGraphics.jg(abyte1, 0, zy + 6, true, 2, false);
			int j1 = Cache.ufb;
			for (int l1 = 1; j1 > 0; l1++) {
				int j2 = j1;
				j1 -= 30;
				if (j2 > 30) {
					j2 = 30;
				}
				DataOperations.readFromPath("../gamedata/media/objects" + l1
						+ ".tga", abyte1, 0x186a0);
				gameGraphics.cg(abyte1, 0, nw + (l1 - 1) * 30, true, 10,
						(j2 + 9) / 10, false);
			}

			DataOperations.readFromPath("../gamedata/media/projectile.tga",
					abyte1, 0x186a0);
			gameGraphics.jg(abyte1, 0, vz, true, Cache.hjb, false);
			return;
		} catch (IOException _ex) {
			System.out.println("ERROR: in raw media loader");
		}
	}

	public void loadEntities(boolean arg0) {
		iw = 0;
		jw = iw;
		byte abyte0[] = null;
		if (qj() && arg0) {
			String s = "entity" + Versions.entityVersion + ".jag";
			try {
				abyte0 = updareProgressBar(s, "people and monsters", 30);
			} catch (IOException ioexception) {
				System.out.println("Load error:" + ioexception);
			}
		} else {
			drawProgressBar(30, "Loading people and monsters");
		}
		int i1 = 0;
		label0: for (int j1 = 0; j1 < Cache.totalEntities; j1++) {
			String s1 = Cache.animationType[j1];
			for (int k1 = 0; k1 < j1; k1++) {
				if (!Cache.animationType[k1].equalsIgnoreCase(s1)) {
					continue;
				}
				Cache.zhb[j1] = Cache.zhb[k1];
				continue label0;
			}

			if (arg0) {
				if (qj()) {
					boolean flag = true;
					if (Cache.genderModel[j1] != 0) {
						flag = false;
					}
					gameGraphics.jg(DataOperations.lm(s1 + ".tga", 0, abyte0),
							0, jw, true, 15, flag);
					i1 += 15;
					if (Cache.xhb[j1] == 1) {
						gameGraphics.jg(
								DataOperations.lm(s1 + "a.tga", 0, abyte0), 0,
								jw + 15, true, 3, true);
						i1 += 3;
					}
					if (Cache.animationNumber[j1] == 1) {
						gameGraphics.jg(
								DataOperations.lm(s1 + "f.tga", 0, abyte0), 0,
								jw + 18, true, 9, true);
						i1 += 9;
					}
				} else {
					try {
						byte abyte1[] = new byte[0x493e0];
						DataOperations.readFromPath("../gamedata/entity/" + s1
								+ ".tga", abyte1, 0x493e0);
						i1 += 15;
						boolean flag1 = true;
						if (Cache.genderModel[j1] != 0) {
							flag1 = false;
						}
						gameGraphics.jg(abyte1, 0, jw, true, 15, flag1);
						if (Cache.xhb[j1] == 1) {
							DataOperations.readFromPath("../gamedata/entity/"
									+ s1 + "a.tga", abyte1, 0x493e0);
							i1 += 3;
							gameGraphics.jg(abyte1, 0, jw + 15, true, 3, true);
						}
						if (Cache.animationNumber[j1] == 1) {
							DataOperations.readFromPath("../gamedata/entity/"
									+ s1 + "f.tga", abyte1, 0x493e0);
							i1 += 9;
							gameGraphics.jg(abyte1, 0, jw + 18, true, 9, true);
						}
					} catch (IOException _ex) {
						System.out.println("ERROR: in raw entity loader - no:"
								+ j1 + " " + s1);
					}
				}
			}
			Cache.zhb[j1] = jw;
			jw += 27;
		}

		System.out.println("Loaded: " + i1 + " frames of animation");
	}

	public void loadTextures() {
		if (qj()) {
			gameCamera.yg("textures" + Versions.textureVersion + ".jag", 7, 11,
					50, this);
			return;
		} else {
			drawProgressBar(50, "Loading textures");
			gameCamera.gi("../gamedata/textures");
			return;
		}
	}

	public void loadModels() {
		Cache.loadModel("torcha2");
		Cache.loadModel("torcha3");
		Cache.loadModel("torcha4");
		Cache.loadModel("skulltorcha2");
		Cache.loadModel("skulltorcha3");
		Cache.loadModel("skulltorcha4");
		Cache.loadModel("firea2");
		Cache.loadModel("firea3");
		if (qj()) {
			byte abyte0[] = null;
			try {
				abyte0 = updareProgressBar("models" + Versions.modelsVersion + ".jag",
						"3d models", 70);
			} catch (IOException ioexception) {
				System.out.println("Load error:" + ioexception);
			}
			for (int j1 = 0; j1 < Cache.lkb; j1++) {
				int k1 = DataOperations.mm(Cache.mkb[j1] + ".ob2", abyte0);
				if (k1 != 0) {
					gameDataModels[j1] = new Model(abyte0, k1);
				} else {
					gameDataModels[j1] = new Model(1, 1);
				}
			}

			return;
		}
		drawProgressBar(70, "Loading 3d models");
		for (int i1 = 0; i1 < Cache.lkb; i1++) {
			gameDataModels[i1] = new Model("../gamedata/models/"
					+ Cache.mkb[i1] + ".ob2");
		}

	}

	public void loadLandscape() {
		if (qj()) {
			terrain.geb = null;
			try {
				terrain.geb = updareProgressBar("maps" + Versions.mapVersion + ".jag", "map",
						90);
				return;
			} catch (IOException ioexception) {
				System.out.println("Load error:" + ioexception);
			}
			return;
		} else {
			terrain.udb = false;
			return;
		}
	}

	public void drawGameMenu() {
		gameMenu = new Menu(gameGraphics, 10);
		lz = gameMenu.bc(5, 269, 502, 56, 1, 20, true);
		chatHandle = gameMenu.cc(7, 324, 498, 14, 1, 80, false, true);
		nz = gameMenu.bc(5, 269, 502, 56, 1, 20, true);
		oz = gameMenu.bc(5, 269, 502, 56, 1, 20, true);
		gameMenu.lc(chatHandle);
	}

	public void dj() {

		loginTimer++;
		if (loggedIn == 0) {
			super.lastActionTimeout = 0;
			ck();
		}
		if (loggedIn == 1) {
			jt++;
			super.lastActionTimeout++;
			processGame();
		}
		if (at > 0) {
			at--;
		}
		if (zs && at == 0) {
			zs = false;
			super.streamClass.formatPacket();
			at = 24;
		}
		super.pq = 0;
		super.rq = 0;
		if (gz > 0) {
			gz--;
		}
		if (hz > 0) {
			hz--;
		}
		if (iz > 0) {
			iz--;
		}
		if (jz > 0) {
			jz--;
		}
	}

	public void jj() {
		if (error) {
			Graphics g1 = getGraphics();
			g1.setColor(Color.black);
			g1.fillRect(0, 0, 512, 356);
			g1.setFont(new Font("Helvetica", 1, 20));
			g1.setColor(Color.white);
			g1.drawString("Error - unable to load game!", 50, 50);
			g1.drawString("To play RuneScape make sure you play from", 50, 100);
			g1.drawString("http://www.runescape.com", 50, 150);
			lj(1);
			return;
		}
		if (loggedIn == 0) {
			gameGraphics.vk = false;
			dl();
		}
		if (loggedIn == 1) {
			gameGraphics.vk = true;
			drawGame();
		}
	}

	public void garbageCollect() {
		sendLogoutPacket();
		if (gameGraphics != null) {
			gameGraphics.cleanupSprites();
			gameGraphics.imagePixelArray = null;
			gameGraphics = null;
		}
		if (gameCamera != null) {
			gameCamera.cleanupModels();
			gameCamera = null;
		}
		gameDataModels = null;
		objectModelArray = null;
		doorModel = null;
		mobArray = null;
		playerArray = null;
		npcRecordArray = null;
		npcArray = null;
		ourPlayer = null;
		if (terrain != null) {
			terrain.xeb = null;
			terrain.yeb = null;
			terrain.zeb = null;
			terrain.afb = null;
			terrain = null;
		}
		System.gc();
	}

	public void sj() {
		ot.drawImage(rt, 0, 0, this);
	}

	public void handleMenuKeyDown(int arg0) {
		switch (arg0) {
		case 1005:
			if (cameraHeight < 6000) {
				cameraHeight += 20;
			}
			break;
		case 1004:
			if (cameraHeight > 620) {
				cameraHeight -= 20;
			}
			break;

		}

		if (loggedIn == 0) {
			if (bz == 0) {
				registerMenu.keyDown(arg0);
			}
			if (bz == 1) {
				welcomeMenu.keyDown(arg0);
			}
			if (bz == 2) {
				loginMenu.keyDown(arg0);
			}
		}
		if (showCharacterLookScreen) {
			characterDesignMenu.keyDown(arg0);
		}
		if (loggedIn == 1) {
			if (gt == 0 && ht == 0) {
				gameMenu.keyDown(arg0);
			}
			if (gt == 3 || gt == 4) {
				gt = 0;
			}
		}
	}

	public void sendPacket() {
		super.streamClass.formatPacket();
		zs = true;
		resetLastPing();
	}

	public void resetLoginVars() {
		loggedIn = 0;
		bz = 0;
		cz = "";
		dz = "";
		ez = "Please enter a username:";
		fz = "*" + cz + "*";
		playerCount = 0;
		npcCount = 0;
	}

	public void resetPrivateMessageStrings() {
		super.inputMessage = "";
		super.enteredMessage = "";
	}

	public void drawCharacterDesignMenu() {
		characterDesignMenu = new Menu(gameGraphics, 100);
		characterDesignMenu.drawText(256, 10, "Design Your Character", 4, true);
		char c1 = '\214';
		int i1 = 34;
		characterDesignMenu.yc(c1, i1, 200, 25);
		characterDesignMenu.drawText(c1, i1, "Appearance", 4, false);
		i1 += 15;
		characterDesignMenu.drawText(c1 - 55, i1 + 110, "Front", 3, true);
		characterDesignMenu.drawText(c1, i1 + 110, "Side", 3, true);
		characterDesignMenu.drawText(c1 + 55, i1 + 110, "Back", 3, true);
		byte byte0 = 54;
		i1 += 145;
		characterDesignMenu.ic(c1 - byte0, i1, 53, 41);
		characterDesignMenu.drawText(c1 - byte0, i1 - 8, "Head", 1, true);
		characterDesignMenu.drawText(c1 - byte0, i1 + 8, "Type", 1, true);
		characterDesignMenu.jc(c1 - byte0 - 40, i1, Menu.eg + 7);
		yab = characterDesignMenu.id(c1 - byte0 - 40, i1, 20, 20);
		characterDesignMenu.jc((c1 - byte0) + 40, i1, Menu.eg + 6);
		zab = characterDesignMenu.id((c1 - byte0) + 40, i1, 20, 20);
		characterDesignMenu.ic(c1 + byte0, i1, 53, 41);
		characterDesignMenu.drawText(c1 + byte0, i1 - 8, "Hair", 1, true);
		characterDesignMenu.drawText(c1 + byte0, i1 + 8, "Color", 1, true);
		characterDesignMenu.jc((c1 + byte0) - 40, i1, Menu.eg + 7);
		abb = characterDesignMenu.id((c1 + byte0) - 40, i1, 20, 20);
		characterDesignMenu.jc(c1 + byte0 + 40, i1, Menu.eg + 6);
		bbb = characterDesignMenu.id(c1 + byte0 + 40, i1, 20, 20);
		i1 += 50;
		characterDesignMenu.ic(c1 - byte0, i1, 53, 41);
		characterDesignMenu.drawText(c1 - byte0, i1, "Gender", 1, true);
		characterDesignMenu.jc(c1 - byte0 - 40, i1, Menu.eg + 7);
		cbb = characterDesignMenu.id(c1 - byte0 - 40, i1, 20, 20);
		characterDesignMenu.jc((c1 - byte0) + 40, i1, Menu.eg + 6);
		dbb = characterDesignMenu.id((c1 - byte0) + 40, i1, 20, 20);
		characterDesignMenu.ic(c1 + byte0, i1, 53, 41);
		characterDesignMenu.drawText(c1 + byte0, i1 - 8, "Top", 1, true);
		characterDesignMenu.drawText(c1 + byte0, i1 + 8, "Color", 1, true);
		characterDesignMenu.jc((c1 + byte0) - 40, i1, Menu.eg + 7);
		ebb = characterDesignMenu.id((c1 + byte0) - 40, i1, 20, 20);
		characterDesignMenu.jc(c1 + byte0 + 40, i1, Menu.eg + 6);
		fbb = characterDesignMenu.id(c1 + byte0 + 40, i1, 20, 20);
		i1 += 50;
		characterDesignMenu.ic(c1 - byte0, i1, 53, 41);
		characterDesignMenu.drawText(c1 - byte0, i1 - 8, "Skin", 1, true);
		characterDesignMenu.drawText(c1 - byte0, i1 + 8, "Color", 1, true);
		characterDesignMenu.jc(c1 - byte0 - 40, i1, Menu.eg + 7);
		gbb = characterDesignMenu.id(c1 - byte0 - 40, i1, 20, 20);
		characterDesignMenu.jc((c1 - byte0) + 40, i1, Menu.eg + 6);
		hbb = characterDesignMenu.id((c1 - byte0) + 40, i1, 20, 20);
		characterDesignMenu.ic(c1 + byte0, i1, 53, 41);
		characterDesignMenu.drawText(c1 + byte0, i1 - 8, "Bottom", 1, true);
		characterDesignMenu.drawText(c1 + byte0, i1 + 8, "Color", 1, true);
		characterDesignMenu.jc((c1 + byte0) - 40, i1, Menu.eg + 7);
		ibb = characterDesignMenu.id((c1 + byte0) - 40, i1, 20, 20);
		characterDesignMenu.jc(c1 + byte0 + 40, i1, Menu.eg + 6);
		jbb = characterDesignMenu.id(c1 + byte0 + 40, i1, 20, 20);
		c1 = '\u0174';
		i1 = 35;
		characterDesignMenu.yc(c1, i1, 200, 25);
		characterDesignMenu.drawText(c1, i1, "Character Type", 4, false);
		i1 += 22;
		characterDesignMenu.drawText(c1, i1,
				"Each character type has different starting", 0, true);
		i1 += 13;
		characterDesignMenu.drawText(c1, i1, "bonuses. But the choice you make here",
				0, true);
		i1 += 13;
		characterDesignMenu.drawText(c1, i1,
				"isn't permanent, and will change depending", 0, true);
		i1 += 13;
		characterDesignMenu.drawText(c1, i1, "on how you play the game.", 0, true);
		i1 += 73;
		characterDesignMenu.ic(c1, i1, 215, 125);
		String as[] = { "Adventurer", "Warrior", "Wizard", "Ranger", "Miner" };
		lbb = characterDesignMenu.ac(c1, i1 + 2, as, 3, true);
		i1 += 75;
		characterDesignMenu.ic(c1, i1 + 21, 215, 60);
		characterDesignMenu.drawText(c1, i1,
				"Do you wish to be able to fight with other", 0, true);
		i1 += 13;
		characterDesignMenu.drawText(c1, i1,
				"players? Warning! If you choose 'yes' then", 0, true);
		i1 += 13;
		characterDesignMenu.drawText(c1, i1,
				"other players will be able to attack you too!", 0, true);
		i1 += 13;
		String as1[] = { "No thanks", "Yes I'll fight" };
		mbb = characterDesignMenu.qc(c1, i1, as1, 1, true);
		i1 += 32;
		characterDesignMenu.yc(c1, i1, 200, 30);
		characterDesignMenu.drawText(c1, i1, "Start Game", 4, false);
		kbb = characterDesignMenu.id(c1, i1, 200, 30);
	}

	public void drawCharacterLookScreen() {
		gameGraphics.rk = false;
		gameGraphics.df();
		characterDesignMenu.tc(0, 0, windowWidth, windowHeight);
		characterDesignMenu.drawMenu();
		char c1 = '\214';
		byte byte0 = 50;
		gameGraphics.xf(c1 - 32 - 55, byte0, 64, 102, Cache.zhb[vbb], bcb[ybb]);
		gameGraphics.spriteClip4(c1 - 32 - 55, byte0, 64, 102, Cache.zhb[ubb],
				bcb[xbb], dcb[zbb], 0, false);
		gameGraphics.spriteClip4(c1 - 32 - 55, byte0, 64, 102, Cache.zhb[tbb],
				ccb[wbb], dcb[zbb], 0, false);
		gameGraphics.xf(c1 - 32, byte0, 64, 102, Cache.zhb[vbb] + 6, bcb[ybb]);
		gameGraphics.spriteClip4(c1 - 32, byte0, 64, 102, Cache.zhb[ubb] + 6,
				bcb[xbb], dcb[zbb], 0, false);
		gameGraphics.spriteClip4(c1 - 32, byte0, 64, 102, Cache.zhb[tbb] + 6,
				ccb[wbb], dcb[zbb], 0, false);
		gameGraphics.xf((c1 - 32) + 55, byte0, 64, 102, Cache.zhb[vbb] + 12,
				bcb[ybb]);
		gameGraphics.spriteClip4((c1 - 32) + 55, byte0, 64, 102,
				Cache.zhb[ubb] + 12, bcb[xbb], dcb[zbb], 0, false);
		gameGraphics.spriteClip4((c1 - 32) + 55, byte0, 64, 102,
				Cache.zhb[tbb] + 12, ccb[wbb], dcb[zbb], 0, false);
		gameGraphics.drawPicutre(0, windowHeight, az + 22);
		gameGraphics.drawImage(ot, 0, 11);
	}

	public void dontKnow() {
		characterDesignMenu.md(super.mouseX, super.mouseY, super.pq, super.mouseDownButton);
		if (characterDesignMenu.hasActivated(yab)) {
			do {
				tbb = ((tbb - 1) + Cache.totalEntities) % Cache.totalEntities;
			} while ((Cache.genderModel[tbb] & 3) != 1
					|| (Cache.genderModel[tbb] & 4 * acb) == 0);
		}
		if (characterDesignMenu.hasActivated(zab)) {
			do {
				tbb = (tbb + 1) % Cache.totalEntities;
			} while ((Cache.genderModel[tbb] & 3) != 1
					|| (Cache.genderModel[tbb] & 4 * acb) == 0);
		}
		if (characterDesignMenu.hasActivated(abb)) {
			wbb = ((wbb - 1) + ccb.length) % ccb.length;
		}
		if (characterDesignMenu.hasActivated(bbb)) {
			wbb = (wbb + 1) % ccb.length;
		}
		if (characterDesignMenu.hasActivated(cbb)
				|| characterDesignMenu.hasActivated(dbb)) {
			for (acb = 3 - acb; (Cache.genderModel[tbb] & 3) != 1
					|| (Cache.genderModel[tbb] & 4 * acb) == 0; tbb = (tbb + 1)
					% Cache.totalEntities) {
				;
			}
			for (; (Cache.genderModel[ubb] & 3) != 2
					|| (Cache.genderModel[ubb] & 4 * acb) == 0; ubb = (ubb + 1)
					% Cache.totalEntities) {
				;
			}
		}
		if (characterDesignMenu.hasActivated(ebb)) {
			xbb = ((xbb - 1) + bcb.length) % bcb.length;
		}
		if (characterDesignMenu.hasActivated(fbb)) {
			xbb = (xbb + 1) % bcb.length;
		}
		if (characterDesignMenu.hasActivated(gbb)) {
			zbb = ((zbb - 1) + dcb.length) % dcb.length;
		}
		if (characterDesignMenu.hasActivated(hbb)) {
			zbb = (zbb + 1) % dcb.length;
		}
		if (characterDesignMenu.hasActivated(ibb)) {
			ybb = ((ybb - 1) + bcb.length) % bcb.length;
		}
		if (characterDesignMenu.hasActivated(jbb)) {
			ybb = (ybb + 1) % bcb.length;
		}
		if (characterDesignMenu.hasActivated(kbb)) {
			super.streamClass.createPacket(236);
			super.streamClass.addByte(acb);
			super.streamClass.addByte(tbb);
			super.streamClass.addByte(ubb);
			super.streamClass.addByte(vbb);
			super.streamClass.addByte(wbb);
			super.streamClass.addByte(xbb);
			super.streamClass.addByte(ybb);
			super.streamClass.addByte(zbb);
			super.streamClass.addByte(characterDesignMenu.rc(lbb));
			super.streamClass.addByte(characterDesignMenu.rc(mbb));
			super.streamClass.formatPacket();
			showCharacterLookScreen = false;
		}
	}

	public void drawLoginMenu() {
		registerMenu = new Menu(gameGraphics, 50);
		int i1 = 35;
		registerMenu.drawText(250, 200 + i1, "Click on an option", 5, true);
		registerMenu.yc(150, 240 + i1, 120, 35);
		registerMenu.yc(350, 240 + i1, 120, 35);
		registerMenu.drawText(150, 240 + i1, "New User", 5, false);
		registerMenu.drawText(350, 240 + i1, "Existing User", 5, false);
		bab = registerMenu.id(150, 240 + i1, 120, 35);
		cab = registerMenu.id(350, 240 + i1, 120, 35);
		i1 = 60;
		byte byte0 = 110;
		boolean flag = false;
		welcomeMenu = new Menu(gameGraphics, 50);
		welcomeMenu.yc(250, i1 + 17, 420, 34);
		welcomeMenu.drawText(250, i1 + 8,
				"Choose a Username (This is the name other users will see)", 4,
				flag);
		mab = welcomeMenu.vc(250, i1 + 25, 200, 40, 4, 12, false, flag);
		i1 += 40;
		welcomeMenu.yc(250, i1 + 17, 420, 34);
		welcomeMenu.drawText(250, i1 + 8,
				"Choose a Password (You will require this to login)", 4, flag);
		oab = welcomeMenu.vc(250, i1 + 25, 200, 40, 4, 12, false, flag);
		i1 += 40;
		welcomeMenu.yc(250, i1 + 17, 420, 34);
		welcomeMenu.drawText(250, i1 + 8, "E-mail address", 4, flag);
		nab = welcomeMenu.vc(250, i1 + 25, 200, 40, 4, 40, false, flag);
		i1 += 40;
		welcomeMenu.yc(250, i1 + 22, 420, 44);
		welcomeMenu
				.drawText(250,
						i1 + 7,
						"Do you want to receive our free weekly newsletter? Get news of the latest",
						1, flag);
		welcomeMenu
				.drawText(250,
						i1 + 21,
						"improvements, new-quests!, hints+tips, hiscores, special-events! etc...",
						1, flag);
		String as[] = { "Yes sounds great!", "No-thanks" };
		iab = welcomeMenu.qc(250, i1 + 35, as, 1, flag);
		i1 += 50;
		welcomeMenu.yc(((250 - byte0) + 50) - 15, i1 + 17, 270, 34);
		dab = welcomeMenu.drawText(((250 - byte0) + 50) - 15, i1 + 8,
				"To create an account please enter", 4, true);
		eab = welcomeMenu.drawText(((250 - byte0) + 50) - 15, i1 + 25,
				"all the requested details", 4, true);
		welcomeMenu.yc(350, i1 + 17, 70, 34);
		welcomeMenu.drawText(350, i1 + 17, "Submit", 5, flag);
		lab = welcomeMenu.id(335, i1 + 17, 100, 34);
		welcomeMenu.yc(425, i1 + 17, 70, 34);
		welcomeMenu.drawText(425, i1 + 17, "Cancel", 5, flag);
		kab = welcomeMenu.id(425, i1 + 17, 100, 34);
		welcomeMenu.lc(mab);
		loginMenu = new Menu(gameGraphics, 50);
		i1 = 83;
		loginMenu.yc(250, i1, 300, 40);
		pab = loginMenu.drawText(250, i1 - 10, "Please enter your", 5, true);
		qab = loginMenu.drawText(250, i1 + 10, "username and password", 5, true);
		i1 += 60;
		loginMenu.yc(250, i1, 200, 40);
		loginMenu.drawText(250, i1 - 10, "Username:", 4, flag);
		rab = loginMenu.vc(250, i1 + 10, 200, 40, 4, 12, false, flag);
		i1 += 60;
		loginMenu.yc(250, i1, 200, 40);
		loginMenu.drawText(250, i1 - 10, "Password:", 4, flag);
		sab = loginMenu.vc(250, i1 + 10, 200, 40, 4, 20, true, flag);
		i1 += 60;
		byte0 = 70;
		loginMenu.yc(250 - byte0, i1, 110, 40);
		loginMenu.drawText(250 - byte0, i1, "Ok", 4, flag);
		tab = loginMenu.id(250 - byte0, i1, 110, 40);
		loginMenu.yc(250 + byte0, i1, 110, 40);
		loginMenu.drawText(250 + byte0, i1, "Cancel", 4, flag);
		uab = loginMenu.id(250 + byte0, i1, 110, 40);
		loginMenu.lc(rab);
		agreementMenu = new Menu(gameGraphics, 50);
		i1 = 20;
		agreementMenu
				.drawText(250, i1, "Runescape-Rules / Terms+Conditions", 5, true);
		i1 += 30;
		agreementMenu.gc(40, i1 - 10, 420, 220);
		pbb = agreementMenu.bc(50, i1, 400, 200, 1, 1000, true);
		em(agreementMenu, pbb);
		i1 += 240;
		agreementMenu.yc(120, i1, 170, 50);
		agreementMenu.drawText(120, i1 - 10, "I have read the terms", 1, false);
		agreementMenu.drawText(120, i1, "and conditions above", 1, false);
		agreementMenu.drawText(120, i1 + 10, "And I Agree", 1, false);
		nbb = agreementMenu.id(120, i1, 170, 50);
		agreementMenu.yc(380, i1, 170, 50);
		agreementMenu.drawText(380, i1, "I do not agree", 1, false);
		obb = agreementMenu.id(380, i1, 170, 50);
	}

	public void dl() {
		gameGraphics.rk = false;
		gameGraphics.df();
		if (bz == 0) {
			gameGraphics._mthif(256, 95, az + 10);
		}
		if (bz == 0) {
			registerMenu.tc(0, 0, windowWidth, windowHeight);
			registerMenu.drawMenu();
		}
		if (bz == 1) {
			welcomeMenu.tc(0, 0, windowWidth, windowHeight);
			welcomeMenu.drawMenu();
		}
		if (bz == 2) {
			loginMenu.tc(0, 0, windowWidth, windowHeight);
			loginMenu.drawMenu();
		}
		if (bz == 3) {
			agreementMenu.tc(0, 0, windowWidth, windowHeight);
			agreementMenu.drawMenu();
		}
		gameGraphics.drawPicutre(0, windowHeight, az + 22);
		gameGraphics.drawImage(ot, 0, 11);
	}

	public void ck() {
		if (bz == 0) {
			registerMenu.md(super.mouseX, super.mouseY, super.pq, super.mouseDownButton);
			if (registerMenu.hasActivated(bab)) {
				bz = 3;
			}
			if (registerMenu.hasActivated(cab)) {
				bz = 2;
				loginMenu.updateText(pab, "Please enter your");
				loginMenu.updateText(qab, "username and password");
				loginMenu.updateText(rab, "");
				loginMenu.updateText(sab, "");
				loginMenu.lc(rab);
				return;
			}
		} else if (bz == 1) {
			welcomeMenu.md(super.mouseX, super.mouseY, super.pq, super.mouseDownButton);
			if (welcomeMenu.hasActivated(mab)) {
				welcomeMenu.lc(oab);
			}
			if (welcomeMenu.hasActivated(oab)) {
				welcomeMenu.lc(nab);
			}
			if (welcomeMenu.hasActivated(nab)) {
				welcomeMenu.lc(mab);
			}
			if (welcomeMenu.hasActivated(kab)) {
				bz = 0;
			}
			if (welcomeMenu.hasActivated(lab)) {
				if (welcomeMenu.getText(mab) != null
						&& welcomeMenu.getText(mab).length() == 0
						|| welcomeMenu.getText(nab) != null
						&& welcomeMenu.getText(nab).length() == 0
						|| welcomeMenu.getText(oab) != null
						&& welcomeMenu.getText(oab).length() == 0) {
					welcomeMenu.updateText(dab, "Please fill in ALL requested");
					welcomeMenu.updateText(eab, "information to continue!");
					return;
				}
				welcomeMenu.updateText(dab, "Please wait...");
				welcomeMenu.updateText(eab, "Creating new account");
				dl();
				pj();
				welcomeMenu.getText(fab);
				welcomeMenu.getText(gab);
				String s = welcomeMenu.getText(mab);
				String s1 = welcomeMenu.getText(oab);
				String s2 = welcomeMenu.getText(nab);
				int i1 = welcomeMenu.rc(jab);
				int j1 = welcomeMenu.rc(iab);
				int k1 = 0;
				String s3 = welcomeMenu.getText(hab);
				try {
					k1 = Integer.parseInt(s3);
				} catch (Exception _ex) {
				}
				newPlayer(s, s1, s2, i1, k1, j1);
				return;
			}
		} else {
			if (bz == 2) {
				loginMenu.md(super.mouseX, super.mouseY, super.pq, super.mouseDownButton);
				if (loginMenu.hasActivated(uab)) {
					bz = 0;
				}
				if (loginMenu.hasActivated(rab)) {
					loginMenu.lc(sab);
				}
				if (loginMenu.hasActivated(sab) || loginMenu.hasActivated(tab)) {
					cz = loginMenu.getText(rab);
					dz = loginMenu.getText(sab);
					login(cz, dz);
				}
				return;
			}
			if (bz == 3) {
				agreementMenu.md(super.mouseX, super.mouseY, super.pq, super.mouseDownButton);
				if (agreementMenu.hasActivated(nbb)) {
					bz = 1;
					welcomeMenu.updateText(dab,
							"To create an account please enter");
					welcomeMenu.updateText(eab, "all the requested details");
					welcomeMenu.updateText(mab, "");
					welcomeMenu.updateText(nab, "");
					welcomeMenu.updateText(oab, "");
					welcomeMenu.lc(mab);
				}
				if (agreementMenu.hasActivated(obb)) {
					bz = 0;
				}
			}
		}
	}

	public void drawText(String arg0, String arg1) {
		if (bz == 1) {
			welcomeMenu.updateText(dab, arg0);
			welcomeMenu.updateText(eab, arg1);
		}
		if (bz == 2) {
			loginMenu.updateText(pab, arg0);
			loginMenu.updateText(qab, arg1);
		}
		fz = arg1;
		dl();
		pj();
	}

	public void resetIntVars() {
		bz = 0;
		loggedIn = 0;
	}

	public void q() {
		resetVars();
	}

	public void resetVars() {
		combatStyle = 0;
		bz = 0;
		loggedIn = 1;
		resetPrivateMessageStrings();
		gameGraphics.df();
		gameGraphics.drawImage(ot, 0, 11);
		for (int i1 = 0; i1 < objectCount; i1++) {
			gameCamera.removeModel(objectModelArray[i1]);
			terrain.updateObject(objectX[i1], objectY[i1], objectType[i1]);
		}

		for (int j1 = 0; j1 < doorCount; j1++) {
			gameCamera.removeModel(doorModel[j1]);
			terrain.updateDoor(doorX[j1], doorY[j1], doorDirection[j1], doorType[j1]);
		}

		objectCount = 0;
		doorCount = 0;
		groundItemCount = 0;
		playerCount = 0;
		for (int k1 = 0; k1 < uv; k1++) {
			mobArray[k1] = null;
		}

		for (int l1 = 0; l1 < vv; l1++) {
			playerArray[l1] = null;
		}

		npcCount = 0;
		for (int i2 = 0; i2 < dw; i2++) {
			npcRecordArray[i2] = null;
		}

		for (int j2 = 0; j2 < ew; j2++) {
			npcArray[j2] = null;
		}

		mx = 0;
		super.pq = 0;
		super.mouseDownButton = 0;
	}

	public void hb() {
		String s = welcomeMenu.getText(mab);
		String s1 = welcomeMenu.getText(oab);
		bz = 2;
		loginMenu.updateText(pab, "Please enter your");
		loginMenu.updateText(qab, "username and password");
		loginMenu.updateText(rab, s);
		loginMenu.updateText(sab, s1);
		dl();
		pj();
		login(s, s1);
	}

	public void em(Menu arg0, int arg1) {
		arg0.ec(arg1, "Runescape rules of use", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"In order to keep runescape enjoyable for everyone there are a few",
				false);
		arg0.ec(arg1,
				"rules you must observe. You must agree to these rules to play",
				false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"When using the built in chat facility you must not use any language",
				false);
		arg0.ec(arg1,
				"which may be considered by others to be offensive, racist or",
				false);
		arg0.ec(arg1,
				"obscene. You must not use the chat facility to harass, threaten or",
				false);
		arg0.ec(arg1, "deceive other players.", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"You must not exploit any cheats or errors which you find in the",
				false);
		arg0.ec(arg1,
				"game, to give yourself an unfair advantage. Any exploits which you",
				false);
		arg0.ec(arg1, "find must be immediately reported to Jagex Software.",
				false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"You must not attempt to use other programs in conjunction with",
				false);
		arg0.ec(arg1,
				"RuneScape to give yourself an unfair advantage at the game. You",
				false);
		arg0.ec(arg1,
				"may not use any bots or macros to control your character for you.",
				false);
		arg0.ec(arg1,
				"When you are not playing the game you must log-out. You may not",
				false);
		arg0.ec(arg1,
				"circumvent any of our mechanisms designed to log out inactive",
				false);
		arg0.ec(arg1, "players automatically.", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"You must not create multiple characters and use them to help each",
				false);
		arg0.ec(arg1,
				"other. You may create more than one character, but if you do, you",
				false);
		arg0.ec(arg1,
				"may not log in more than one at any time, and they must not interact",
				false);
		arg0.ec(arg1,
				"with each other in any way. If you wish to form an adventuring",
				false);
		arg0.ec(arg1,
				"party you should do so by cooperating with other players in the game",
				false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1, "Terms and conditions", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"You agree that your character and account in runescape, is the",
				false);
		arg0.ec(arg1,
				"property of, and remains the property of Jagex Software. You may",
				false);
		arg0.ec(arg1,
				"not sell, transfer, or lend your character to anyone else. We may",
				false);
		arg0.ec(arg1,
				"delete or modify your character at any time for any reason.",
				false);
		arg0.ec(arg1,
				"For instance failing to follow the rules above may be cause for",
				false);
		arg0.ec(arg1, "IMMEDIATE DELETION of all your characters.", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"You agree that for purposes such as preventing offensive language",
				false);
		arg0.ec(arg1,
				"we may automatically or manually censor the chat as we see fit,",
				false);
		arg0.ec(arg1,
				"and that we may record the chat to help us identify offenders.",
				false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"No Warranty is supplied with this Software. All implied warranties",
				false);
		arg0.ec(arg1,
				"conditions or terms are excluded to the fullest extent permitted by",
				false);
		arg0.ec(arg1,
				"law. We do not warrant that the operation of the Software will be",
				false);
		arg0.ec(arg1,
				"uninterrupted or error free. We accept no responsibility for any",
				false);
		arg0.ec(arg1,
				"consequential or indirect loss or damages. You use this software at",
				false);
		arg0.ec(arg1,
				"your own risk, and assume full responsibility for any and all real,",
				false);
		arg0.ec(arg1,
				"claimed, or supposed damages that may occur as a result of running",
				false);
		arg0.ec(arg1, "this software.", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"We reserve all rights related to the runescape name, logo, web site,",
				false);
		arg0.ec(arg1,
				"and game. All materials associated with runescape are protected",
				false);
		arg0.ec(arg1,
				"by UK copyright laws and all other applicable national laws, and",
				false);
		arg0.ec(arg1,
				"may not be copied, reproduced, republished, uploaded, posted,",
				false);
		arg0.ec(arg1,
				"transmitted, or distributed in any way without our prior written",
				false);
		arg0.ec(arg1,
				"consent. We reserve the right to modify or remove this game at any",
				false);
		arg0.ec(arg1,
				"time. You agree that we may change this service, and these terms",
				false);
		arg0.ec(arg1, "and conditions, as and when we deem necessary.", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"We accept no responsibility for the actions of other users of our",
				false);
		arg0.ec(arg1,
				"website. You acknowledge that it is inpractical for us to control",
				false);
		arg0.ec(arg1,
				"and monitor everything that users do in our game or post on our",
				false);
		arg0.ec(arg1,
				"message boards, and that we therefore cannot be held responsible",
				false);
		arg0.ec(arg1,
				"for any abusive or inappropriate content which appears on our site",
				false);
		arg0.ec(arg1, "as a result.", false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"Occasionally we may accept ideas and game additions from the",
				false);
		arg0.ec(arg1,
				"players. You agree that by submitting material for inclusion in",
				false);
		arg0.ec(arg1,
				"runescape you are giving us a non-exclusive, perpetual, worldwide,",
				false);
		arg0.ec(arg1,
				"royalty-free license to use or modify the submission as we see",
				false);
		arg0.ec(arg1,
				"fit. You agree that you will not withdraw the submission or attempt",
				false);
		arg0.ec(arg1,
				"to make a charge for its use. Furthermore you warrant that you",
				false);
		arg0.ec(arg1,
				"are the exclusive copyright holder of the submission, and that the",
				false);
		arg0.ec(arg1,
				"submission in no way violates any other person or entity's rights",
				false);
		arg0.ec(arg1, "", false);
		arg0.ec(arg1,
				"These Terms shall be governed by the laws of England, and the",
				false);
		arg0.ec(arg1,
				"courts of England shall have exclusive jurisdiction in all matters",
				false);
		arg0.ec(arg1, "arising.", false);
	}

	public void processGame() {
		sendPingPacketReadPacketData();
		if (super.lastActionTimeout > 4500 && lastDeath == 0) {
			sendLogoutPacket();
			return;
		}
		if (ourPlayer.currentSprite == 8 || ourPlayer.currentSprite == 9) {
			lastDeath = 500;
		}
		if (lastDeath > 0) {
			lastDeath--;
		}
		for (int playerLoop = 0; playerLoop < playerCount; playerLoop++) {
			Mob currentPlayer = playerArray[playerLoop];
			int k1 = (currentPlayer.waypointCurrent + 1) % 10;
			if (currentPlayer.waypointEndSprite != k1) {
				int j2 = -1;
				int k4 = currentPlayer.waypointEndSprite;
				int k5;
				if (k4 < k1) {
					k5 = k1 - k4;
				} else {
					k5 = (10 + k1) - k4;
				}
				int j6 = 4;
				if (k5 > 2) {
					j6 = (k5 - 1) * 4;
				}
				if (currentPlayer.waypointsX[k4] - currentPlayer.currentX > magicLoc * 3
						|| currentPlayer.waypointsY[k4]
								- currentPlayer.currentY > magicLoc * 3
						|| currentPlayer.waypointsX[k4]
								- currentPlayer.currentX < -magicLoc * 3
						|| currentPlayer.waypointsY[k4]
								- currentPlayer.currentY < -magicLoc * 3
						|| k5 > 8) {
					currentPlayer.currentX = currentPlayer.waypointsX[k4];
					currentPlayer.currentY = currentPlayer.waypointsY[k4];
				} else {
					if (currentPlayer.currentX < currentPlayer.waypointsX[k4]) {
						currentPlayer.currentX += j6;
						currentPlayer.stepCount++;
						j2 = 2;
					} else if (currentPlayer.currentX > currentPlayer.waypointsX[k4]) {
						currentPlayer.currentX -= j6;
						currentPlayer.stepCount++;
						j2 = 6;
					}
					if (currentPlayer.currentX - currentPlayer.waypointsX[k4] < j6
							&& currentPlayer.currentX
									- currentPlayer.waypointsX[k4] > -j6) {
						currentPlayer.currentX = currentPlayer.waypointsX[k4];
					}
					if (currentPlayer.currentY < currentPlayer.waypointsY[k4]) {
						currentPlayer.currentY += j6;
						currentPlayer.stepCount++;
						if (j2 == -1) {
							j2 = 4;
						} else if (j2 == 2) {
							j2 = 3;
						} else {
							j2 = 5;
						}
					} else if (currentPlayer.currentY > currentPlayer.waypointsY[k4]) {
						currentPlayer.currentY -= j6;
						currentPlayer.stepCount++;
						if (j2 == -1) {
							j2 = 0;
						} else if (j2 == 2) {
							j2 = 1;
						} else {
							j2 = 7;
						}
					}
					if (currentPlayer.currentY - currentPlayer.waypointsY[k4] < j6
							&& currentPlayer.currentY
									- currentPlayer.waypointsY[k4] > -j6) {
						currentPlayer.currentY = currentPlayer.waypointsY[k4];
					}
				}
				if (j2 != -1) {
					currentPlayer.currentSprite = j2;
				}
				if (currentPlayer.currentX == currentPlayer.waypointsX[k4]
						&& currentPlayer.currentY == currentPlayer.waypointsY[k4]) {
					currentPlayer.waypointEndSprite = (k4 + 1) % 10;
				}
			} else {
				currentPlayer.currentSprite = currentPlayer.nextSprite;
			}
			if (currentPlayer.lastMessageTimeout > 0) {
				currentPlayer.lastMessageTimeout--;
			}
			if (currentPlayer.anInt163 > 0) {
				currentPlayer.anInt163--;
			}
			if (currentPlayer.combatTimer > 0) {
				currentPlayer.combatTimer--;
			}
			if (playerAliveTimeout > 0) {
				playerAliveTimeout--;
				if (playerAliveTimeout == 0) {
					displayMessage(
							"You have been granted another life. Be more careful this time!",
							3);
				}
				if (playerAliveTimeout == 0) {
					displayMessage(
							"You retain your skills. Unless you attacked another player recently,",
							3);
				}
				if (playerAliveTimeout == 0) {
					displayMessage(
							"you also keep your best 3 items. Everything else lands where you died.",
							3);
				}
			}
		}

		for (int npcLoop = 0; npcLoop < npcCount; npcLoop++) {
			Mob currentNpc = npcArray[npcLoop];
			if (currentNpc == null) {
				System.err.println("Null Npc!!");
				continue;
			}
			int k2 = 0;
			try {
				k2 = (currentNpc.waypointCurrent + 1) % 10;
			} catch (NullPointerException e) {
				e.printStackTrace();
			}
			if (currentNpc.waypointEndSprite != k2) {
				int l4 = -1;
				int l5 = currentNpc.waypointEndSprite;
				int k6;
				if (l5 < k2) {
					k6 = k2 - l5;
				} else {
					k6 = (10 + k2) - l5;
				}
				int l6 = 4;
				if (k6 > 2) {
					l6 = (k6 - 1) * 4;
				}
				if (currentNpc.waypointsX[l5] - currentNpc.currentX > magicLoc * 3
						|| currentNpc.waypointsY[l5] - currentNpc.currentY > magicLoc * 3
						|| currentNpc.waypointsX[l5] - currentNpc.currentX < -magicLoc * 3
						|| currentNpc.waypointsY[l5] - currentNpc.currentY < -magicLoc * 3
						|| k6 > 8) {
					currentNpc.currentX = currentNpc.waypointsX[l5];
					currentNpc.currentY = currentNpc.waypointsY[l5];
				} else {
					if (currentNpc.currentX < currentNpc.waypointsX[l5]) {
						currentNpc.currentX += l6;
						currentNpc.stepCount++;
						l4 = 2;
					} else if (currentNpc.currentX > currentNpc.waypointsX[l5]) {
						currentNpc.currentX -= l6;
						currentNpc.stepCount++;
						l4 = 6;
					}
					if (currentNpc.currentX - currentNpc.waypointsX[l5] < l6
							&& currentNpc.currentX - currentNpc.waypointsX[l5] > -l6) {
						currentNpc.currentX = currentNpc.waypointsX[l5];
					}
					if (currentNpc.currentY < currentNpc.waypointsY[l5]) {
						currentNpc.currentY += l6;
						currentNpc.stepCount++;
						if (l4 == -1) {
							l4 = 4;
						} else if (l4 == 2) {
							l4 = 3;
						} else {
							l4 = 5;
						}
					} else if (currentNpc.currentY > currentNpc.waypointsY[l5]) {
						currentNpc.currentY -= l6;
						currentNpc.stepCount++;
						if (l4 == -1) {
							l4 = 0;
						} else if (l4 == 2) {
							l4 = 1;
						} else {
							l4 = 7;
						}
					}
					if (currentNpc.currentY - currentNpc.waypointsY[l5] < l6
							&& currentNpc.currentY - currentNpc.waypointsY[l5] > -l6) {
						currentNpc.currentY = currentNpc.waypointsY[l5];
					}
				}
				if (l4 != -1) {
					currentNpc.currentSprite = l4;
				}
				if (currentNpc.currentX == currentNpc.waypointsX[l5]
						&& currentNpc.currentY == currentNpc.waypointsY[l5]) {
					currentNpc.waypointEndSprite = (l5 + 1) % 10;
				}
			} else {
				currentNpc.currentSprite = currentNpc.nextSprite;
			}
			if (currentNpc.lastMessageTimeout > 0) {
				currentNpc.lastMessageTimeout--;
			}
			if (currentNpc.anInt163 > 0) {
				currentNpc.anInt163--;
			}
			if (currentNpc.combatTimer > 0) {
				currentNpc.combatTimer--;
			}
		}

		for (int i2 = 0; i2 < playerCount; i2++) {
			Mob l3 = playerArray[i2];
			if (l3.anInt176 > 0) {
				l3.anInt176--;
			}
		}

		if (bt) {
			if (nu - ourPlayer.currentX < -500 || nu - ourPlayer.currentX > 500
					|| ou - ourPlayer.currentY < -500
					|| ou - ourPlayer.currentY > 500) {
				nu = ourPlayer.currentX;
				ou = ourPlayer.currentY;
			}
		} else {
			if (nu - ourPlayer.currentX < -500 || nu - ourPlayer.currentX > 500
					|| ou - ourPlayer.currentY < -500
					|| ou - ourPlayer.currentY > 500) {
				nu = ourPlayer.currentX;
				ou = ourPlayer.currentY;
			}
			if (nu != ourPlayer.currentX) {
				nu += (ourPlayer.currentX - nu)
						/ (16 + (cameraHeight - 500) / 15);
			}
			if (ou != ourPlayer.currentY) {
				ou += (ourPlayer.currentY - ou)
						/ (16 + (cameraHeight - 500) / 15);
			}
			if (cameraAngleMode) {
				int i3 = cameraAutoAngle * 32;
				int i5 = i3 - cameraRotation;
				byte byte0 = 1;
				if (i5 != 0) {
					qu++;
					if (i5 > 128) {
						byte0 = -1;
						i5 = 256 - i5;
					} else if (i5 > 0) {
						byte0 = 1;
					} else if (i5 < -128) {
						byte0 = 1;
						i5 = 256 + i5;
					} else if (i5 < 0) {
						byte0 = -1;
						i5 = -i5;
					}
					cameraRotation += ((qu * i5 + 255) / 256) * byte0;
					cameraRotation &= 0xff;
				} else {
					qu = 0;
				}
			}
		}
		if (showCharacterLookScreen) {
			dontKnow();
			return;
		}
		if (super.mouseY > windowHeight - 4) {
			if (super.mouseX > 15 && super.mouseX < 96 && super.pq == 1) {
				pz = 0;
			}
			if (super.mouseX > 110 && super.mouseX < 194 && super.pq == 1) {
				pz = 1;
				gameMenu.ue[lz] = 0xf423f;
			}
			if (super.mouseX > 215 && super.mouseX < 295 && super.pq == 1) {
				pz = 2;
				gameMenu.ue[nz] = 0xf423f;
			}
			if (super.mouseX > 315 && super.mouseX < 395 && super.pq == 1) {
				pz = 3;
				gameMenu.ue[oz] = 0xf423f;
			}
			super.pq = 0;
			super.mouseDownButton = 0;
		}
		gameMenu.md(super.mouseX, super.mouseY, super.pq, super.mouseDownButton);
		if (pz > 0 && super.mouseX >= 494 && super.mouseY >= windowHeight - 66) {
			super.pq = 0;
		}
		if (gameMenu.hasActivated(chatHandle)) {
			String s = gameMenu.getText(chatHandle);
			gameMenu.updateText(chatHandle, "");
			if (s.startsWith("::")) {
				s = s.substring(2);
				streamClass.createPacket(90);
				streamClass.addString(s);
				streamClass.formatPacket();
				return;
			}
			if (!isTellCommand(s)) {
				ourPlayer.lastMessageTimeout = 150;
				ourPlayer.lastMessage = s;
				displayMessage(ourPlayer.name + ": " + s, 2);
			}
		}
		if (pz == 0) {
			for (int j3 = 0; j3 < qz; j3++) {
				if (sz[j3] > 0) {
					sz[j3]--;
				}
			}
		}
		if (playerAliveTimeout != 0) {
			super.pq = 0;
		}
		if (showTradeWindow) {
			if (super.mouseDownButton != 0) {
				ey++;
			} else {
				ey = 0;
			}
			if (ey > 300) {
				fy += 50;
			} else if (ey > 150) {
				fy += 5;
			} else if (ey > 50) {
				fy++;
			} else if (ey > 20 && (ey & 5) == 0) {
				fy++;
			}
		} else {
			ey = 0;
			fy = 0;
		}
		if (super.pq == 1) {
			mx = 1;
		} else if (super.pq == 2) {
			mx = 2;
		}
		gameCamera.ph(super.mouseX, super.mouseY);
		super.pq = 0;
		if (cameraAngleMode) {
			if (qu == 0 || bt) {
				if (super.keyLeftDown) {
					cameraAutoAngle = cameraAutoAngle + 1 & 7;
					super.keyLeftDown = false;
					if (!zoomCamera) {
						if ((cameraAutoAngle & 1) == 0) {
							cameraAutoAngle = cameraAutoAngle + 1 & 7;
						}
						for (int k3 = 0; k3 < 8; k3++) {
							if (enginePlayerVisible(cameraAutoAngle)) {
								break;
							}
							cameraAutoAngle = cameraAutoAngle + 1 & 7;
						}

					}
				}
				if (super.keyRightDown) {
					cameraAutoAngle = cameraAutoAngle + 7 & 7;
					super.keyRightDown = false;
					if (!zoomCamera) {
						if ((cameraAutoAngle & 1) == 0) {
							cameraAutoAngle = cameraAutoAngle + 7 & 7;
						}
						for (int i4 = 0; i4 < 8; i4++) {
							if (enginePlayerVisible(cameraAutoAngle)) {
								break;
							}
							cameraAutoAngle = cameraAutoAngle + 7 & 7;
						}

					}
				}
			}
		} else if (super.keyLeftDown) {
			cameraRotation = cameraRotation + 2 & 0xff;
		} else if (super.keyRightDown) {
			cameraRotation = cameraRotation - 2 & 0xff;
		}
		if (zoomCamera && cameraHeight > 550) {
			cameraHeight -= 4;
		} else if (!zoomCamera && cameraHeight < 750) {
			cameraHeight += 4;
		}
		if (actionPictureType > 0) {
			actionPictureType--;
		} else if (actionPictureType < 0) {
			actionPictureType++;
		}
		gameCamera.ai(17);
		modelUpdatingTimer++;
		if (modelUpdatingTimer > 5) {
			modelUpdatingTimer = 0;
			ocb = ocb + 1 & 3;
			pcb = (pcb + 1) % 3;
		}
		for (int j4 = 0; j4 < objectCount; j4++) {
			int j5 = objectX[j4];
			int i6 = objectY[j4];
			if (j5 >= 0 && i6 >= 0 && j5 < 96 && i6 < 96
					&& objectType[j4] == 74) {
				objectModelArray[j4].pe(1, 0, 0);
			}
		}

	}

	public void displayMessage(String arg0, int arg1) {
		if (arg1 == 2 || arg1 == 4 || arg1 == 6) {
			for (; arg0.length() > 5 && arg0.charAt(0) == '@'
					&& arg0.charAt(4) == '@'; arg0 = arg0.substring(5)) {
				;
			}
			int i1 = arg0.indexOf(":");
			if (i1 != -1) {
				String s = arg0.substring(0, i1);
				long l1 = DataOperations.stringLength12ToLong(s);
				for (int k1 = 0; k1 < super.ignoreListCount; k1++) {
					if (super.ignoreListLongs[k1] == l1) {
						return;
					}
				}

			}
		}
		if (arg1 == 2) {
			arg0 = "@yel@" + arg0;
		}
		if (arg1 == 3 || arg1 == 4) {
			arg0 = "@whi@" + arg0;
		}
		if (arg1 == 6) {
			arg0 = "@cya@" + arg0;
		}
		if (pz != 0) {
			if (arg1 == 4 || arg1 == 3) {
				gz = 200;
			}
			if (arg1 == 2 && pz != 1) {
				hz = 200;
			}
			if (arg1 == 5 && pz != 2) {
				iz = 200;
			}
			if (arg1 == 6 && pz != 3) {
				jz = 200;
			}
			if (arg1 == 3 && pz != 0) {
				pz = 0;
			}
			if (arg1 == 6 && pz != 3 && pz != 0) {
				pz = 3;
			}
		}
		for (int j1 = qz - 1; j1 > 0; j1--) {
			rz[j1] = rz[j1 - 1];
			sz[j1] = sz[j1 - 1];
		}

		rz[0] = arg0;
		sz[0] = 300;
		if (arg1 == 2) {
			if (gameMenu.ue[lz] == gameMenu.menuListTextCount[lz] - 4) {
				gameMenu.ec(lz, arg0, true);
			} else {
				gameMenu.ec(lz, arg0, false);
			}
		}
		if (arg1 == 5) {
			if (gameMenu.ue[nz] == gameMenu.menuListTextCount[nz] - 4) {
				gameMenu.ec(nz, arg0, true);
			} else {
				gameMenu.ec(nz, arg0, false);
			}
		}
		if (arg1 == 6) {
			if (gameMenu.ue[oz] == gameMenu.menuListTextCount[oz] - 4) {
				gameMenu.ec(oz, arg0, true);
				return;
			}
			gameMenu.ec(oz, arg0, false);
		}
	}

	public void handleServerMessage(String message) {
		if (message.equals("@sys@k")) {
			sendLogoutPacket();
			return;
		}
		if (message.startsWith("@cha@")) {
			displayMessage(message, 2);
			return;
		}
		if (message.startsWith("@bor@")) {
			displayMessage(message, 4);
			return;
		}
		if (message.startsWith("@que@")) {
			displayMessage("@whi@" + message, 5);
			return;
		}
		if (message.startsWith("@pri@")) {
			displayMessage(message, 6);
			return;
		} else {
			displayMessage(message, 3);
			return;
		}
	}

	protected void handleIncomingPacket(int command, int length, byte data[]) {
		try {
			if (command == 230) {
				int configVer = data[1] & 0xff;
				int mapVer = data[2] & 0xff;
				int mediaVer = data[3] & 0xff;
				int modelVer = data[4] & 0xff;
				int textureVer = data[5] & 0xff;
				int entityVer = data[6] & 0xff;
				if (configVer > Versions.confVersion
						|| mapVer > Versions.mapVersion
						|| mediaVer > Versions.mediaVersion
						|| modelVer > Versions.modelsVersion
						|| textureVer > Versions.textureVersion
						|| entityVer > Versions.entityVersion) {
					sendLogoutPacket();
					super.up = "Runescape has been updated. Getting latest files";
					super.loadingScreen = 2;
					drawProgressBar(0, "Loading");
					if (configVer > Versions.confVersion) {
						Versions.confVersion = configVer;
						loadConfiguration();
					}
					if (mediaVer > Versions.mediaVersion) {
						Versions.mediaVersion = mediaVer;
						loadMedia();
					}
					if (entityVer > Versions.entityVersion) {
						Versions.entityVersion = entityVer;
						loadEntities(true);
					} else {
						loadEntities(false);
					}
					if (textureVer > Versions.textureVersion) {
						Versions.textureVersion = textureVer;
						loadTextures();
					}
					if (modelVer > Versions.modelsVersion) {
						Versions.modelsVersion = modelVer;
						loadModels();
					}
					if (mapVer > Versions.mapVersion) {
						Versions.mapVersion = mapVer;
						loadLandscape();
					}
					terrain.playerIsAlive = false;
					lastWildyYSubtract = -1;
					super.loadingScreen = 0;
					login(cz, dz);
					return;
				}
			}
			if (command == 232) {
				int j1 = (length - 1) / 2;
				for (int i6 = 0; i6 < j1; i6++) {
					int l10 = DataOperations
							.getUnsigned2Bytes(data, 1 + i6 * 2);
					for (int j15 = 0; j15 < playerCount; j15++) {
						Mob l19 = playerArray[j15];
						if (l19 == null || l19.serverIndex == l10) {
							playerCount--;
							for (int j23 = j15; j23 < playerCount; j23++) {
								playerArray[j23] = playerArray[j23 + 1];
							}
							j15--;
						}
					}

				}

			}
			if (command == 231) {
				int num_npc = (length - 1) / 2;
				for (int curLoop = 0; curLoop < num_npc; curLoop++) {
					int someIndex = DataOperations.getUnsigned2Bytes(data,
							1 + curLoop * 2);
					for (int npcLoop = 0; npcLoop < npcCount; npcLoop++) {
						Mob npc_ = npcArray[npcLoop];
						if (npc_ == null || npc_.serverIndex == someIndex) {
							npcCount--;
							for (int anotherLoop = npcLoop; anotherLoop < npcCount; anotherLoop++) {
								npcArray[anotherLoop] = npcArray[anotherLoop + 1];
							}
							npcLoop--;
						}
					}

				}
			}
			try {
				if (command == 145) {
					if (!hasWorldInfo) {
						return;
					}
					lastPlayerCount = playerCount;
					for (int k = 0; k < lastPlayerCount; k++) {
						lastPlayerArray[k] = playerArray[k];
					}

					int currentOffset = 8;
					sectionX = DataOperations.getIntFromByteArray(data,
							currentOffset, 11);
					currentOffset += 11;
					sectionY = DataOperations.getIntFromByteArray(data,
							currentOffset, 13);
					currentOffset += 13;
					int mobSprite = DataOperations.getIntFromByteArray(data,
							currentOffset, 4);
					currentOffset += 4;
					boolean sectionLoaded = loadSection(sectionX, sectionY);
					sectionX -= areaX;
					sectionY -= areaY;
					int mapEnterX = sectionX * magicLoc + 64;
					int mapEnterY = sectionY * magicLoc + 64;
					if (sectionLoaded) {
						ourPlayer.waypointCurrent = 0;
						ourPlayer.waypointEndSprite = 0;
						ourPlayer.currentX = ourPlayer.waypointsX[0] = mapEnterX;
						ourPlayer.currentY = ourPlayer.waypointsY[0] = mapEnterY;
					}
					playerCount = 0;
					ourPlayer = makePlayer(serverIndex, mapEnterX, mapEnterY,
							mobSprite);
					int newPlayerCount = DataOperations.getIntFromByteArray(
							data, currentOffset, 8);
					currentOffset += 8;
					for (int currentNewPlayer = 0; currentNewPlayer < newPlayerCount; currentNewPlayer++) {
						Mob lastMob = getLastPlayer(DataOperations
								.getIntFromByteArray(data, currentOffset, 16));
						currentOffset += 16;
						int nextPlayer = DataOperations.getIntFromByteArray(
								data, currentOffset, 1); // 1
						currentOffset++;
						if (nextPlayer != 0) {
							int waypointsLeft = DataOperations
									.getIntFromByteArray(data, currentOffset, 1); // 2
							currentOffset++;
							if (waypointsLeft == 0) {
								int currentNextSprite = DataOperations
										.getIntFromByteArray(data,
												currentOffset, 3); // 3
								currentOffset += 3;
								int currentWaypoint = lastMob.waypointCurrent;
								int newWaypointX = lastMob.waypointsX[currentWaypoint];
								int newWaypointY = lastMob.waypointsY[currentWaypoint];
								if (currentNextSprite == 2
										|| currentNextSprite == 1
										|| currentNextSprite == 3) {
									newWaypointX += magicLoc;
								}
								if (currentNextSprite == 6
										|| currentNextSprite == 5
										|| currentNextSprite == 7) {
									newWaypointX -= magicLoc;
								}
								if (currentNextSprite == 4
										|| currentNextSprite == 3
										|| currentNextSprite == 5) {
									newWaypointY += magicLoc;
								}
								if (currentNextSprite == 0
										|| currentNextSprite == 1
										|| currentNextSprite == 7) {
									newWaypointY -= magicLoc;
								}
								lastMob.nextSprite = currentNextSprite;
								lastMob.waypointCurrent = currentWaypoint = (currentWaypoint + 1) % 10;
								lastMob.waypointsX[currentWaypoint] = newWaypointX;
								lastMob.waypointsY[currentWaypoint] = newWaypointY;
							} else {
								int needsNextSprite = DataOperations
										.getIntFromByteArray(data,
												currentOffset, 4);
								currentOffset += 4;
								if ((needsNextSprite & 0xc) == 12) {
									continue;
								}
								lastMob.nextSprite = needsNextSprite;
							}
						}
						playerArray[playerCount++] = lastMob;
					}

					int mobCount = 0;
					while (currentOffset + 24 < length * 8) {
						int mobIndex = DataOperations.getIntFromByteArray(data,
								currentOffset, 16);
						currentOffset += 16;
						int areaMobX = DataOperations.getIntFromByteArray(data,
								currentOffset, 5);
						currentOffset += 5;
						if (areaMobX > 15) {
							areaMobX -= 32;
						}
						int areaMobY = DataOperations.getIntFromByteArray(data,
								currentOffset, 5);
						currentOffset += 5;
						if (areaMobY > 15) {
							areaMobY -= 32;
						}
						int mobArrayMobID = DataOperations.getIntFromByteArray(
								data, currentOffset, 4);
						currentOffset += 4;
						int addIndex = DataOperations.getIntFromByteArray(data,
								currentOffset, 1);
						currentOffset++;
						int mobX = (sectionX + areaMobX) * magicLoc + 64;
						int mobY = (sectionY + areaMobY) * magicLoc + 64;
						makePlayer(mobIndex, mobX, mobY, mobArrayMobID);
						if (addIndex == 0) {
							mobArrayIndexes[mobCount++] = mobIndex;
						}
					}
					if (mobCount > 0) {
						super.streamClass.createPacket(83);
						super.streamClass.add2ByteInt(mobCount);
						for (int currentMob = 0; currentMob < mobCount; currentMob++) {
							Mob dummyMob = mobArray[mobArrayIndexes[currentMob]];
							super.streamClass.add2ByteInt(dummyMob.serverIndex);
							super.streamClass
									.add2ByteInt(dummyMob.mobIntUnknown);
						}
						super.streamClass.formatPacket();
						mobCount = 0;
					}
					return;
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
			if (command == 254) {
				for (int i2 = 1; i2 < length;) {
					if (DataOperations.getUnsignedByte(data[i2]) == 255) {
						int newCount = 0;
						int newSectionX = sectionX + data[i2 + 1] >> 3;
						int newSectionY = sectionY + data[i2 + 2] >> 3;
						i2 += 3;
						for (int groundItem = 0; groundItem < groundItemCount; groundItem++) {
							int newX = (groundItemX[groundItem] >> 3)
									- newSectionX;
							int newY = (groundItemY[groundItem] >> 3)
									- newSectionY;
							if (newX != 0 || newY != 0) {
								if (groundItem != newCount) {
									groundItemX[newCount] = groundItemX[groundItem];
									groundItemY[newCount] = groundItemY[groundItem];
									groundItemType[newCount] = groundItemType[groundItem];
									groundItemObjectVar[newCount] = groundItemObjectVar[groundItem];
								}
								newCount++;
							}
						}

						groundItemCount = newCount;
					} else {
						int i7 = DataOperations.getUnsigned2Bytes(data, i2);
						i2 += 2;
						int l11 = sectionX + data[i2++];
						int j16 = sectionY + data[i2++];
						if ((i7 & 0x8000) == 0) {
							groundItemX[groundItemCount] = l11;
							groundItemY[groundItemCount] = j16;
							groundItemType[groundItemCount] = i7;
							groundItemObjectVar[groundItemCount] = 0;
							for (int j20 = 0; j20 < objectCount; j20++) {
								if (objectX[j20] != l11 || objectY[j20] != j16) {
									continue;
								}
								groundItemObjectVar[groundItemCount] = Cache.groundItemVar[objectType[j20]];
								break;
							}

							groundItemCount++;
						} else {
							i7 &= 0x7fff;
							int k20 = 0;
							for (int k24 = 0; k24 < groundItemCount; k24++) {
								if (groundItemX[k24] != l11
										|| groundItemY[k24] != j16
										|| groundItemType[k24] != i7) {
									if (k24 != k20) {
										groundItemX[k20] = groundItemX[k24];
										groundItemY[k20] = groundItemY[k24];
										groundItemType[k20] = groundItemType[k24];
										groundItemObjectVar[k20] = groundItemObjectVar[k24];
									}
									k20++;
								} else {
									i7 = -123;
								}
							}

							groundItemCount = k20;
						}
					}
				}

				return;
			}
			if (command == 253) {
				for (int j2 = 1; j2 < length;) {
					if (DataOperations.getUnsignedByte(data[j2]) == 255) {
						int j7 = 0;
						int i12 = sectionX + data[j2 + 1] >> 3;
						int k16 = sectionY + data[j2 + 2] >> 3;
						j2 += 3;
						for (int i21 = 0; i21 < objectCount; i21++) {
							int l24 = (objectX[i21] >> 3) - i12;
							int k27 = (objectY[i21] >> 3) - k16;
							if (l24 != 0 || k27 != 0) {
								if (i21 != j7) {
									objectModelArray[j7] = objectModelArray[i21];
									objectModelArray[j7].ph = j7;
									objectX[j7] = objectX[i21];
									objectY[j7] = objectY[i21];
									objectType[j7] = objectType[i21];
									objectID[j7] = objectID[i21];
								}
								j7++;
							} else {
								gameCamera.removeModel(objectModelArray[i21]);
								terrain.updateObject(objectX[i21],
										objectY[i21], objectType[i21]);
							}
						}

						objectCount = j7;
					} else {
						int k7 = DataOperations.getUnsigned2Bytes(data, j2);
						j2 += 2;
						int j12 = sectionX + data[j2++];
						int l16 = sectionY + data[j2++];
						int l29 = data[j2++];
						int j21 = 0;
						for (int i25 = 0; i25 < objectCount; i25++) {
							if (objectX[i25] != j12 || objectY[i25] != l16) {
								if (i25 != j21) {
									objectModelArray[j21] = objectModelArray[i25];
									objectModelArray[j21].ph = j21;
									objectX[j21] = objectX[i25];
									objectY[j21] = objectY[i25];
									objectType[j21] = objectType[i25];
									objectID[j21] = objectID[i25];
								}
								j21++;
							} else {
								gameCamera.removeModel(objectModelArray[i25]);
								terrain.updateObject(objectX[i25],
										objectY[i25], objectType[i25]);
							}
						}

						objectCount = j21;
						if (k7 != 60000) {
							int l27 = terrain.dn(j12, l16);
							int k31;
							int k34;
							if (l27 == 0 || l27 == 4) {
								k31 = Cache.gib[k7];
								k34 = Cache.hib[k7];
							} else {
								k34 = Cache.gib[k7];
								k31 = Cache.hib[k7];
							}
							int i37 = ((j12 + j12 + k31) * magicLoc) / 2;
							int k38 = ((l16 + l16 + k34) * magicLoc) / 2;
							int l39 = Cache.objectID[k7];
							Model model_1 = gameDataModels[l39].le();
							gameCamera.addModel(model_1);
							model_1.ph = objectCount;
							model_1.pe(0, l27 * 32, 0);
							model_1.wd(i37,
									-terrain.getAveragedElevation(i37, k38),
									k38);
							model_1.ne(true, 48, 48, -50, -10, -50);
							terrain.pn(j12, l16, k7);
							if (k7 == 74) {
								model_1.wd(0, -480, 0);
							}
							objectX[objectCount] = j12;
							objectY[objectCount] = l16;
							objectType[objectCount] = k7;
							objectID[objectCount] = l27;
							objectModelArray[objectCount++] = model_1;
						}
					}
				}
				return;
			}
			if (command == 104) {
				int offset = 1;
				int amount = 1;
				int size = data[offset++] & 0xff;
				int id = DataOperations.getUnsigned2Bytes(data, offset);
				offset += 2;
				amount = DataOperations.readInt(data, offset);
				offset += 4;
				inventoryItems[size] = id & 0x7fff;
				wearing[size] = id / 32768;
				inventoryItemsCount[size] = amount;
				if (size >= inventoryCount) {
					inventoryCount = size + 1;
				}
				return;
			}
			if (command == 105) {
				int slot = data[1] & 0xff;
				inventoryCount--;
				for (int loop = slot; loop < inventoryCount; loop++) {
					inventoryItems[loop] = inventoryItems[loop + 1];
					inventoryItemsCount[loop] = inventoryItemsCount[loop + 1];
					wearing[loop] = wearing[loop + 1];
				}
				return;
			}
			if (command == 106) {
				int offset = 1;
				int itemAmount = 1;
				int slot = data[offset++] & 0xff;
				int itemID = DataOperations.getUnsigned2Bytes(data, offset);
				offset += 2;
				itemAmount = DataOperations.readInt(data, offset);
				offset += 4;
				inventoryItems[slot] = itemID & 0x7fff;
				wearing[slot] = itemID / 32768;
				inventoryItemsCount[slot] = itemAmount;
				if (slot >= inventoryCount) {
					inventoryCount = slot + 1;
				}
				return;
			}
			if (command == 250) {
				int mobCount = DataOperations.getUnsigned2Bytes(data, 1);
				int mobUpdateOffset = 3;
				for (int currentMob = 0; currentMob < mobCount; currentMob++) {
					int mobArrayIndex = DataOperations.getUnsigned2Bytes(data,
							mobUpdateOffset);
					mobUpdateOffset += 2;
					if (mobArrayIndex < 0 || mobArrayIndex > mobArray.length) {
						return;
					}
					Mob mob = mobArray[mobArrayIndex];
					if (mob == null) {
						return;
					}
					byte mobUpdateType = data[mobUpdateOffset++];
					if (mobUpdateType == 0) {
						int j28 = DataOperations.getUnsigned2Bytes(data,
								mobUpdateOffset);
						mobUpdateOffset += 2;
						if (mob != null) {
							mob.anInt163 = 150;
							mob.anInt162 = j28;
						}
					} else if (mobUpdateType == 1) {
						byte byte5 = data[mobUpdateOffset];
						mobUpdateOffset++;
						if (mob != null) {
							String s1 = new String(data, mobUpdateOffset, byte5);
							if (s1.startsWith("@que@")) {
								mob.lastMessageTimeout = 150;
								mob.lastMessage = s1;
								if (mob == ourPlayer) {
									displayMessage("@yel@" + mob.name + ": "
											+ mob.lastMessage, 5);
								}
							} else if (mob != ourPlayer) {
								boolean flag2 = false;
								for (int j37 = 0; j37 < super.ignoreListCount; j37++) {
									if (super.ignoreListLongs[j37] == mob.nameLong) {
										flag2 = true;
									}
								}

								if (!flag2) {
									s1 = DataOperations.censor(s1, true);
									mob.lastMessageTimeout = 150;
									mob.lastMessage = s1;
									displayMessage(mob.name + ": "
											+ mob.lastMessage, 2);
								}
							}
						}
						mobUpdateOffset += byte5;
					} else if (mobUpdateType == 2) {
						int k28 = DataOperations
								.getUnsignedByte(data[mobUpdateOffset]);
						mobUpdateOffset++;
						int i32 = DataOperations
								.getUnsignedByte(data[mobUpdateOffset]);
						mobUpdateOffset++;
						int i35 = DataOperations
								.getUnsignedByte(data[mobUpdateOffset]);
						mobUpdateOffset++;
						if (mob != null) {
							mob.lastDamage = k28;
							mob.hitPointsCurrent = i32;
							mob.hitPointsBase = i35;
							mob.combatTimer = 200;
							if (mob == ourPlayer) {
								playerStatCurrent[3] = i32;
								playerStatBase[3] = i35;
							}
						}
					} else if (mobUpdateType == 3) {
						int l28 = DataOperations.getUnsigned2Bytes(data,
								mobUpdateOffset);
						mobUpdateOffset += 2;
						int j32 = DataOperations.getUnsigned2Bytes(data,
								mobUpdateOffset);
						mobUpdateOffset += 2;
						if (mob != null) {
							mob.bs = l28;
							mob.ds = j32;
							mob.cs = -1;
							mob.anInt176 = uz;
						}
					} else if (mobUpdateType == 4) {
						int i29 = DataOperations.getUnsigned2Bytes(data,
								mobUpdateOffset);
						mobUpdateOffset += 2;
						int k32 = DataOperations.getUnsigned2Bytes(data,
								mobUpdateOffset);
						mobUpdateOffset += 2;
						if (mob != null) {
							mob.bs = i29;
							mob.cs = k32;
							mob.ds = -1;
							mob.anInt176 = uz;
						}
					} else if (mobUpdateType == 5) {
						if (mob != null) {
							mob.mobIntUnknown = DataOperations
									.getUnsigned2Bytes(data, mobUpdateOffset);
							mobUpdateOffset += 2;
							mob.nameLong = DataOperations.getUnsigned8Bytes(
									data, mobUpdateOffset);
							mobUpdateOffset += 8;
							mob.name = DataOperations
									.longToString(mob.nameLong);
							int wornLength = DataOperations
									.getUnsignedByte(data[mobUpdateOffset]);
							mobUpdateOffset++;
							for (int i28 = 0; i28 < wornLength; i28++) {
								mob.animationCount[i28] = DataOperations
										.getUnsignedByte(data[mobUpdateOffset]);
								mobUpdateOffset++;
							}

							for (int l31 = wornLength; l31 < 12; l31++) {
								mob.animationCount[l31] = 0;
							}

							mob.colourHairType = data[mobUpdateOffset++] & 0xff;
							mob.colourTopType = data[mobUpdateOffset++] & 0xff;
							mob.colourBottomType = data[mobUpdateOffset++] & 0xff;
							mob.colourSkinType = data[mobUpdateOffset++] & 0xff;
							mob.pvpSetting = data[mobUpdateOffset++] & 0xff;
							mob.level = data[mobUpdateOffset++] & 0xff;
							mob.skulled = data[mobUpdateOffset++] & 0xff;
							mob.admin = data[mobUpdateOffset++] & 0xff;
						} else {
							mobUpdateOffset += 14;
							int k25 = DataOperations
									.getUnsignedByte(data[mobUpdateOffset]);
							mobUpdateOffset += k25 + 1;
						}
					}
				}
				return;
			}
			if (command == 249) {
				for (int j3 = 1; j3 < length;) {
					if (DataOperations.getUnsignedByte(data[j3]) == 255) {
						int j8 = 0;
						int i13 = sectionX + data[j3 + 1] >> 3;
						int k17 = sectionY + data[j3 + 2] >> 3;
						j3 += 3;
						for (int k21 = 0; k21 < doorCount; k21++) {
							int l25 = (doorX[k21] >> 3) - i13;
							int j29 = (doorY[k21] >> 3) - k17;
							if (l25 != 0 || j29 != 0) {
								if (k21 != j8) {
									doorModel[j8] = doorModel[k21];
									doorModel[j8].ph = j8 + 10000;
									doorX[j8] = doorX[k21];
									doorY[j8] = doorY[k21];
									doorDirection[j8] = doorDirection[k21];
									doorType[j8] = doorType[k21];
								}
								j8++;
							} else {
								gameCamera.removeModel(doorModel[k21]);
								terrain.updateDoor(doorX[k21], doorY[k21],
										doorDirection[k21], doorType[k21]);
							}
						}

						doorCount = j8;
					} else {
						int k8 = DataOperations.getUnsigned2Bytes(data, j3);
						j3 += 2;
						int j13 = sectionX + data[j3++];
						int l17 = sectionY + data[j3++];
						byte byte3 = data[j3++];
						int i26 = 0;
						for (int k29 = 0; k29 < doorCount; k29++) {
							if (doorX[k29] != j13 || doorY[k29] != l17
									|| doorDirection[k29] != byte3) {
								if (k29 != i26) {
									doorModel[i26] = doorModel[k29];
									doorModel[i26].ph = i26 + 10000;
									doorX[i26] = doorX[k29];
									doorY[i26] = doorY[k29];
									doorDirection[i26] = doorDirection[k29];
									doorType[i26] = doorType[k29];
								}
								i26++;
							} else {
								gameCamera.removeModel(doorModel[k29]);
								terrain.updateDoor(doorX[k29], doorY[k29],
										doorDirection[k29], doorType[k29]);
							}
						}

						doorCount = i26;
						if (k8 != 65535) {
							terrain.bo(j13, l17, byte3, k8);
							Model h1 = makeModel(j13, l17, byte3, k8, doorCount);
							doorModel[doorCount] = h1;
							doorX[doorCount] = j13;
							doorY[doorCount] = l17;
							doorType[doorCount] = k8;
							doorDirection[doorCount++] = byte3;
						}
					}
				}

				return;
			}
			/*
			 * if(command == 248) { int k3 = (length - 1) / 4; int l8 = 1;
			 * for(int k13 = 0; k13 < k3; k13++) { int i18 =
			 * DataOperations.getUnsigned2Bytes(data, l8); int i22 =
			 * DataOperations.getUnsignedByte(data[l8 + 2]); int j26 = i18 >> 6
			 * & 0x3ff; int l29 = i18 >> 1 & 0x1f; if(l29 > 15) l29 -= 32; int
			 * l32 = (i18 << 4 & 0x10) + (i22 >> 4 & 0xf); if(l32 > 15) l32 -=
			 * 32; int j35 = i22 & 0xf; int k37 = (sectionX + l29) * magicLoc +
			 * 64; int l38 = (sectionY + l32) * magicLoc + 64; int i40 =
			 * DataOperations.getUnsignedByte(data[l8 + 3]); l8 += 4; if(i40 >=
			 * r.ogb) i40 = 24; if(npcRecordArray[j26] == null) {
			 * npcRecordArray[j26] = new Mob(); npcRecordArray[j26].serverIndex
			 * = j26; } Mob l40 = npcRecordArray[j26]; boolean flag4 = false;
			 * for(int j40 = 0; j40 < npcCount; j40++) { if(npcArray[j40] !=
			 * l40) continue; flag4 = true; break; }
			 * 
			 * if(!flag4) npcArray[npcCount++] = npcRecordArray[j26]; if(flag4)
			 * { l40.type = i40; l40.nextSprite = j35; int k40 =
			 * l40.waypointCurrent; if(k37 != l40.waypointsX[k40] || l38 !=
			 * l40.waypointsY[k40]) { l40.waypointCurrent = k40 = (k40 + 1) %
			 * 10; l40.waypointsX[k40] = k37; l40.waypointsY[k40] = l38; } }
			 * else { l40.serverIndex = j26; l40.waypointEndSprite = 0;
			 * l40.waypointCurrent = 0; l40.waypointsX[0] = l40.currentX = k37;
			 * l40.waypointsY[0] = l40.currentY = l38; l40.type = i40;
			 * l40.nextSprite = l40.currentSprite = j35; l40.stepCount = 0; } }
			 * 
			 * return; }
			 */
			if (command == 248) {
				lastNpcCount = npcCount;
				npcCount = 0;
				for (int lastNpcIndex = 0; lastNpcIndex < lastNpcCount; lastNpcIndex++) {
					lastNpcArray[lastNpcIndex] = npcArray[lastNpcIndex];
				}

				int newNpcOffset = 8;
				int newNpcCount = DataOperations.getIntFromByteArray(data,
						newNpcOffset, 8);
				newNpcOffset += 8;
				for (int newNpcIndex = 0; newNpcIndex < newNpcCount; newNpcIndex++) {
					Mob newNPC = getLastNpc(DataOperations.getIntFromByteArray(
							data, newNpcOffset, 16));
					newNpcOffset += 16;
					int npcNeedsUpdate = DataOperations.getIntFromByteArray(
							data, newNpcOffset, 1);
					newNpcOffset++;
					if (npcNeedsUpdate != 0) {
						int i32 = DataOperations.getIntFromByteArray(data,
								newNpcOffset, 1);
						newNpcOffset++;
						if (i32 == 0) {
							int nextSprite = DataOperations
									.getIntFromByteArray(data, newNpcOffset, 3);
							newNpcOffset += 3;
							int waypointCurrent = newNPC.waypointCurrent;
							int waypointX = newNPC.waypointsX[waypointCurrent];
							int waypointY = newNPC.waypointsY[waypointCurrent];
							if (nextSprite == 2 || nextSprite == 1
									|| nextSprite == 3) {
								waypointX += magicLoc;
							}
							if (nextSprite == 6 || nextSprite == 5
									|| nextSprite == 7) {
								waypointX -= magicLoc;
							}
							if (nextSprite == 4 || nextSprite == 3
									|| nextSprite == 5) {
								waypointY += magicLoc;
							}
							if (nextSprite == 0 || nextSprite == 1
									|| nextSprite == 7) {
								waypointY -= magicLoc;
							}
							newNPC.nextSprite = nextSprite;
							newNPC.waypointCurrent = waypointCurrent = (waypointCurrent + 1) % 10;
							newNPC.waypointsX[waypointCurrent] = waypointX;
							newNPC.waypointsY[waypointCurrent] = waypointY;
						} else {
							int nextSpriteOffset = DataOperations
									.getIntFromByteArray(data, newNpcOffset, 4);
							newNpcOffset += 4;
							if ((nextSpriteOffset & 0xc) == 12) {
								continue;
							}
							newNPC.nextSprite = nextSpriteOffset;

						}
					}
					npcArray[npcCount++] = newNPC;
				}

				while (newNpcOffset + 34 < length * 8) {
					int serverIndex = DataOperations.getIntFromByteArray(data,
							newNpcOffset, 16);
					newNpcOffset += 16;
					int i28 = DataOperations.getIntFromByteArray(data,
							newNpcOffset, 5);
					newNpcOffset += 5;
					if (i28 > 15) {
						i28 -= 32;
					}
					int j32 = DataOperations.getIntFromByteArray(data,
							newNpcOffset, 5);
					newNpcOffset += 5;
					if (j32 > 15) {
						j32 -= 32;
					}
					int nextSprite = DataOperations.getIntFromByteArray(data,
							newNpcOffset, 4);
					newNpcOffset += 4;
					int x = (sectionX + i28) * magicLoc + 64;
					int y = (sectionY + j32) * magicLoc + 64;
					int type = DataOperations.getIntFromByteArray(data,
							newNpcOffset, 10);
					newNpcOffset += 10;
					if (type >= Cache.totalNpcs) {
						type = 24;
					}
					addNPC(serverIndex, x, y, nextSprite, type);
				}
				return;
			}
			if (command == 247) {
				int updateSize = DataOperations.getUnsigned2Bytes(data, 1);
				int updateOffset = 3;
				for (int curLoop = 0; curLoop < updateSize; curLoop++) {
					int npcIndex = DataOperations.getUnsigned2Bytes(data,
							updateOffset);
					updateOffset += 2;
					Mob mob_2 = npcRecordArray[npcIndex];
					int updateType = DataOperations
							.getUnsignedByte(data[updateOffset]);
					updateOffset++;
					switch (updateType) {
					case 1:
						int updateIndex = DataOperations.getUnsigned2Bytes(
								data, updateOffset);
						updateOffset += 2;
						byte messageLength = data[updateOffset++];
						if (mob_2 != null) {
							String message = new String(data, updateOffset,
									messageLength);
							mob_2.lastMessageTimeout = 150;
							mob_2.lastMessage = message;
							if (updateIndex == ourPlayer.serverIndex) {
								displayMessage("@yel@"
										+ Cache.npcExamine[mob_2.type][0]
										+ ": " + mob_2.lastMessage, 5);
							}
						}
						updateOffset += messageLength;
						break;
					case 2:
						int updateLastDamage = DataOperations
								.getUnsignedByte(data[updateOffset]);
						updateOffset++;
						int updateHPCurrent = DataOperations
								.getUnsignedByte(data[updateOffset]);
						updateOffset++;
						int updateHPBase = DataOperations
								.getUnsignedByte(data[updateOffset]);
						updateOffset++;
						if (mob_2 != null) {
							mob_2.lastDamage = updateLastDamage;
							mob_2.hitPointsCurrent = updateHPCurrent;
							mob_2.hitPointsBase = updateHPBase;
							mob_2.combatTimer = 200;
						}
						break;
					case 3:
						break;
					}
				}
				return;
			}
			if (command == 246) {
				showQuestionMenu = true;
				int questionMenuLength = DataOperations
						.getUnsignedByte(data[1]);
				questionMenuCount = questionMenuLength;
				int offset = 2;
				for (int i14 = 0; i14 < questionMenuLength; i14++) {
					int optionLength = DataOperations
							.getUnsignedByte(data[offset]);
					offset++;
					questionMenuAnswer[i14] = new String(data, offset,
							optionLength);
					offset += optionLength;
				}
				return;
			}
			if (command == 245) {
				showQuestionMenu = false;
				return;
			}
			if (command == 100) {
				int offset = 1;
				for (int loop = 0; loop < 16; loop++) {
					playerStatCurrent[loop] = DataOperations
							.getUnsignedByte(data[offset++]);
				}
				for (int loop = 0; loop < 16; loop++) {
					playerStatBase[loop] = DataOperations
							.getUnsignedByte(data[offset++]);
				}
				questPoints = DataOperations.getUnsignedByte(data[offset++]);
				return;
			}
			if (command == 101) {
				int stat = DataOperations.getUnsignedByte(data[1]);
				playerStatCurrent[stat] = DataOperations
						.getUnsignedByte(data[2]);
				playerStatBase[stat] = DataOperations.getUnsignedByte(data[3]);
				return;
			}
			if (command == 102) {
				hasWorldInfo = true;
				serverIndex = DataOperations.getUnsigned2Bytes(data, 1);
				wildX = DataOperations.getUnsigned2Bytes(data, 3);
				wildY = DataOperations.getUnsigned2Bytes(data, 5);
				wildYSubtract = DataOperations.getUnsigned2Bytes(data, 7);
				wildYMultipler = DataOperations.getUnsigned2Bytes(data, 9);
				wildY -= wildYSubtract * wildYMultipler;
				return;
			}
			if (command == 103) {
				for (int k4 = 0; k4 < 5; k4++) {
					equipmentStatus[k4] = DataOperations
							.getUnsignedByte(data[1 + k4]);
				}
				return;
			}
			if (command == 107) {
				combatStyle = DataOperations.getUnsignedByte(data[1]);
				return;
			}
			if (command == 241) {
				playerAliveTimeout = 250;
				uy += 10;
				return;
			}
			if (command == 240) {
				int l4 = (length - 1) / 4;
				for (int l9 = 0; l9 < l4; l9++) {
					int k14 = sectionX
							+ DataOperations.getSigned2Bytes(data, 1 + l9 * 4) >> 3;
					int l18 = sectionY
							+ DataOperations.getSigned2Bytes(data, 3 + l9 * 4) >> 3;
					int j22 = 0;
					for (int l26 = 0; l26 < groundItemCount; l26++) {
						int k30 = (groundItemX[l26] >> 3) - k14;
						int j33 = (groundItemY[l26] >> 3) - l18;
						if (k30 != 0 || j33 != 0) {
							if (l26 != j22) {
								groundItemX[j22] = groundItemX[l26];
								groundItemY[j22] = groundItemY[l26];
								groundItemType[j22] = groundItemType[l26];
								groundItemObjectVar[j22] = groundItemObjectVar[l26];
							}
							j22++;
						}
					}

					groundItemCount = j22;
					j22 = 0;
					for (int l30 = 0; l30 < objectCount; l30++) {
						int k33 = (objectX[l30] >> 3) - k14;
						int l35 = (objectY[l30] >> 3) - l18;
						if (k33 != 0 || l35 != 0) {
							if (l30 != j22) {
								objectModelArray[j22] = objectModelArray[l30];
								objectModelArray[j22].ph = j22;
								objectX[j22] = objectX[l30];
								objectY[j22] = objectY[l30];
								objectType[j22] = objectType[l30];
								objectID[j22] = objectID[l30];
							}
							j22++;
						} else {
							gameCamera.removeModel(objectModelArray[l30]);
							terrain.updateObject(objectX[l30], objectY[l30],
									objectType[l30]);
						}
					}
					objectCount = j22;
					j22 = 0;
					for (int l33 = 0; l33 < doorCount; l33++) {
						int i36 = (doorX[l33] >> 3) - k14;
						int l37 = (doorY[l33] >> 3) - l18;
						if (i36 != 0 || l37 != 0) {
							if (l33 != j22) {
								doorModel[j22] = doorModel[l33];
								doorModel[j22].ph = j22 + 10000;
								doorX[j22] = doorX[l33];
								doorY[j22] = doorY[l33];
								doorDirection[j22] = doorDirection[l33];
								doorType[j22] = doorType[l33];
							}
							j22++;
						} else {
							gameCamera.removeModel(doorModel[l33]);
							terrain.updateDoor(doorX[l33], doorY[l33],
									doorDirection[l33], doorType[l33]);
						}
					}
					doorCount = j22;
				}
				return;
			}
			if (command == 239) {
				showCharacterLookScreen = true;
				return;
			}
			if (command == 50) {
				int modIndex = DataOperations.getUnsigned2Bytes(data, 1);
				if (mobArray[modIndex] != null) {
					tradeOtherPlayerName = mobArray[modIndex].name;
				}
				showTradeWindow = true;
				tradeOtherAccepted = false;
				tradeWeAccepted = false;
				tradeMyItemCount = 0;
				tradeOtherItemCount = 0;
				return;
			}
			if (command == 51) {
				showTradeWindow = false;
				return;
			}
			if (command == 52) {
				tradeOtherItemCount = data[1] & 0xff;
				int offset = 2;
				for (int loop = 0; loop < tradeOtherItemCount; loop++) {
					tradeOtherItems[loop] = DataOperations.getUnsigned2Bytes(
							data, offset);
					offset += 2;
					tradeOtherAmount[loop] = DataOperations.getUnsigned2Bytes(
							data, offset);
					offset += 2;
				}
				tradeOtherAccepted = false;
				tradeWeAccepted = false;
				return;
			}
			if (command == 53) {
				if (data[1] == 1) {
					tradeWeAccepted = true;
					return;
				} else {
					tradeWeAccepted = false;
					return;
				}
			}
			if (command == 54) {
				byte byte0 = data[1];
				if (byte0 == 1) {
					tradeOtherAccepted = true;
					return;
				} else {
					tradeOtherAccepted = false;
					return;
				}
			}
			if (command == 55) {
				cameraAngleMode = DataOperations.getUnsignedByte(data[1]) == 1;
				playerKiller = DataOperations.getUnsignedByte(data[2]) == 1;
				pvpChangeAvaible = DataOperations.getUnsignedByte(data[3]);
				mouseButtons = DataOperations.getUnsignedByte(data[4]) == 1;
			}
			if (command == 234) {
				showShopWindow = true;
				int offset = 1;
				int shopSize = data[offset++] & 0xff;
				byte general = data[offset++];
				shopSellModifier = data[offset++] & 0xff;
				showBuyModifier = data[offset++] & 0xff;
				for (int i19 = 0; i19 < 40; i19++) {
					shopItemIDs[i19] = -1;
				}

				for (int loop = 0; loop < shopSize; loop++) {
					shopItemIDs[loop] = DataOperations.getUnsigned2Bytes(data,
							offset);
					offset += 2;
					shopItemAmounts[loop] = DataOperations.getUnsigned2Bytes(
							data, offset);
					offset += 2;
					ly[loop] = data[offset++];
				}

				if (general == 1) {
					int i27 = 39;
					for (int i31 = 0; i31 < inventoryCount; i31++) {
						if (i27 < shopSize) {
							break;
						}
						boolean flag1 = false;
						for (int j36 = 0; j36 < 40; j36++) {
							if (shopItemIDs[j36] != inventoryItems[i31]) {
								continue;
							}
							flag1 = true;
							break;
						}

						if (inventoryItems[i31] == 10) {
							flag1 = true;
						}
						if (!flag1) {
							shopItemIDs[i27] = inventoryItems[i31] & 0x7fff;
							shopItemAmounts[i27] = 0;
							ly[i27] = 0;
							i27--;
						}
					}

				}
				if (my >= 0 && my < 40 && shopItemIDs[my] != ny) {
					my = -1;
					ny = -2;
					return;
				}
			}
			if (command == 233) {
				showShopWindow = false;
				return;
			}
			return;
		} catch (RuntimeException runtimeexception) {
			if (mt < 3) {
				/**
				 * super.streamClass.createPacket(17);
				 * super.streamClass.addString(runtimeexception.toString());
				 * sendPacket(); super.streamClass.createPacket(17);
				 * super.streamClass.addString("ptype:" + command + " psize:" +
				 * length); sendPacket(); super.streamClass.createPacket(17);
				 * super.streamClass.addString("rx:" + sectionX + " ry:" +
				 * sectionY + " num3l:" + objectCount); sendPacket(); String s =
				 * ""; for(int l14 = 0; l14 < 80 && l14 < length; l14++) s = s +
				 * data[l14] + " ";
				 * 
				 * super.streamClass.createPacket(17);
				 * super.streamClass.addString(s); sendPacket();
				 */
				mt++;
			}
		}
	}

	private Mob getLastPlayer(int serverIndex) {
		for (int i1 = 0; i1 < lastPlayerCount; i1++) {
			if (lastPlayerArray[i1].serverIndex == serverIndex) {
				return lastPlayerArray[i1];
			}
		}
		return null;
	}

	private Mob getLastNpc(int serverIndex) {
		for (int i1 = 0; i1 < lastNpcCount; i1++) {
			if (lastNpcArray[i1].serverIndex == serverIndex) {
				return lastNpcArray[i1];
			}
		}
		return null;
	}

	private final Mob addNPC(int serverIndex, int x, int y, int nextSprite,
			int type) {
		if (npcRecordArray[serverIndex] == null) {
			npcRecordArray[serverIndex] = new Mob();
			npcRecordArray[serverIndex].serverIndex = serverIndex;
		}
		Mob mob = npcRecordArray[serverIndex];
		boolean npcAlreadyExists = false;
		for (int lastNpcIndex = 0; lastNpcIndex < lastNpcCount; lastNpcIndex++) {
			if (lastNpcArray[lastNpcIndex].serverIndex != serverIndex) {
				continue;
			}
			npcAlreadyExists = true;
			break;
		}

		if (npcAlreadyExists) {
			mob.type = type;
			mob.nextSprite = nextSprite;
			int waypointCurrent = mob.waypointCurrent;
			if (x != mob.waypointsX[waypointCurrent]
					|| y != mob.waypointsY[waypointCurrent]) {
				mob.waypointCurrent = waypointCurrent = (waypointCurrent + 1) % 10;
				mob.waypointsX[waypointCurrent] = x;
				mob.waypointsY[waypointCurrent] = y;
			}
		} else {
			mob.serverIndex = serverIndex;
			mob.waypointEndSprite = 0;
			mob.waypointCurrent = 0;
			mob.waypointsX[0] = mob.currentX = x;
			mob.waypointsY[0] = mob.currentY = y;
			mob.type = type;
			mob.nextSprite = mob.currentSprite = nextSprite;
			mob.stepCount = 0;
		}
		npcArray[npcCount++] = mob;
		return mob;
	}

	private final Mob makePlayer(int mobArrayIndex, int x, int y, int sprite) {
		if (mobArray[mobArrayIndex] == null) {
			mobArray[mobArrayIndex] = new Mob();
			mobArray[mobArrayIndex].serverIndex = mobArrayIndex;
			mobArray[mobArrayIndex].mobIntUnknown = 0;
		}
		Mob mob = mobArray[mobArrayIndex];
		boolean flag = false;
		for (int i1 = 0; i1 < lastPlayerCount; i1++) {
			if (lastPlayerArray[i1].serverIndex != mobArrayIndex) {
				continue;
			}
			flag = true;
			break;
		}

		if (flag) {
			mob.nextSprite = sprite;
			int j1 = mob.waypointCurrent;
			if (x != mob.waypointsX[j1] || y != mob.waypointsY[j1]) {
				mob.waypointCurrent = j1 = (j1 + 1) % 10;
				mob.waypointsX[j1] = x;
				mob.waypointsY[j1] = y;
			}
		} else {
			mob.serverIndex = mobArrayIndex;
			mob.waypointEndSprite = 0;
			mob.waypointCurrent = 0;
			mob.waypointsX[0] = mob.currentX = x;
			mob.waypointsY[0] = mob.currentY = y;
			mob.nextSprite = mob.currentSprite = sprite;
			mob.stepCount = 0;
		}
		playerArray[playerCount++] = mob;
		return mob;
	}

	public boolean enginePlayerVisible(int arg0) {
		int i1 = ourPlayer.currentX / 128;
		int j1 = ourPlayer.currentY / 128;
		for (int k1 = 2; k1 >= 1; k1--) {
			if (arg0 == 1
					&& ((terrain.walkableValue[i1][j1 - k1] & 0x80) == 128
							|| (terrain.walkableValue[i1 - k1][j1] & 0x80) == 128 || (terrain.walkableValue[i1
							- k1][j1 - k1] & 0x80) == 128)) {
				return false;
			}
			if (arg0 == 3
					&& ((terrain.walkableValue[i1][j1 + k1] & 0x80) == 128
							|| (terrain.walkableValue[i1 - k1][j1] & 0x80) == 128 || (terrain.walkableValue[i1
							- k1][j1 + k1] & 0x80) == 128)) {
				return false;
			}
			if (arg0 == 5
					&& ((terrain.walkableValue[i1][j1 + k1] & 0x80) == 128
							|| (terrain.walkableValue[i1 + k1][j1] & 0x80) == 128 || (terrain.walkableValue[i1
							+ k1][j1 + k1] & 0x80) == 128)) {
				return false;
			}
			if (arg0 == 7
					&& ((terrain.walkableValue[i1][j1 - k1] & 0x80) == 128
							|| (terrain.walkableValue[i1 + k1][j1] & 0x80) == 128 || (terrain.walkableValue[i1
							+ k1][j1 - k1] & 0x80) == 128)) {
				return false;
			}
			if (arg0 == 0 && (terrain.walkableValue[i1][j1 - k1] & 0x80) == 128) {
				return false;
			}
			if (arg0 == 2 && (terrain.walkableValue[i1 - k1][j1] & 0x80) == 128) {
				return false;
			}
			if (arg0 == 4 && (terrain.walkableValue[i1][j1 + k1] & 0x80) == 128) {
				return false;
			}
			if (arg0 == 6 && (terrain.walkableValue[i1 + k1][j1] & 0x80) == 128) {
				return false;
			}
		}

		return true;
	}

	public void xk() {
		if ((cameraAutoAngle & 1) == 1 && enginePlayerVisible(cameraAutoAngle)) {
			return;
		}
		if ((cameraAutoAngle & 1) == 0 && enginePlayerVisible(cameraAutoAngle)) {
			if (enginePlayerVisible(cameraAutoAngle + 1 & 7)) {
				cameraAutoAngle = cameraAutoAngle + 1 & 7;
				return;
			}
			if (enginePlayerVisible(cameraAutoAngle + 7 & 7)) {
				cameraAutoAngle = cameraAutoAngle + 7 & 7;
			}
			return;
		}
		int ai[] = { 1, -1, 2, -2, 3, -3, 4 };
		for (int i1 = 0; i1 < 7; i1++) {
			if (!enginePlayerVisible(cameraAutoAngle + ai[i1] + 8 & 7)) {
				continue;
			}
			cameraAutoAngle = cameraAutoAngle + ai[i1] + 8 & 7;
			break;
		}

		if ((cameraAutoAngle & 1) == 0 && enginePlayerVisible(cameraAutoAngle)) {
			if (enginePlayerVisible(cameraAutoAngle + 1 & 7)) {
				cameraAutoAngle = cameraAutoAngle + 1 & 7;
				return;
			}
			if (enginePlayerVisible(cameraAutoAngle + 7 & 7)) {
				cameraAutoAngle = cameraAutoAngle + 7 & 7;
			}
		}
	}

	public void drawGame() {
		if (playerAliveTimeout != 0) {
			gameGraphics.fadePixels();
			gameGraphics.drawText("Oh dear! You are dead...", windowWidth / 2,
					windowHeight / 2, 7, 0xff0000);
			drawChatMessageTabs();
			gameGraphics.drawImage(ot, 0, 11);
			return;
		}
		if (!terrain.playerIsAlive) {
			return;
		}
		if (showCharacterLookScreen) {
			drawCharacterLookScreen();
			return;
		}
		for (int i1 = 0; i1 < 64; i1++) {
			gameCamera.removeModel(terrain.zeb[lastWildyYSubtract][i1]);
			if (lastWildyYSubtract == 0) {
				gameCamera.removeModel(terrain.yeb[1][i1]);
				gameCamera.removeModel(terrain.zeb[1][i1]);
				gameCamera.removeModel(terrain.yeb[2][i1]);
				gameCamera.removeModel(terrain.zeb[2][i1]);
			}
			zoomCamera = true;
			if (lastWildyYSubtract == 0
					&& (terrain.walkableValue[ourPlayer.currentX / 128][ourPlayer.currentY / 128] & 0x80) == 0) {
				gameCamera.addModel(terrain.zeb[lastWildyYSubtract][i1]);
				if (lastWildyYSubtract == 0) {
					gameCamera.addModel(terrain.yeb[1][i1]);
					gameCamera.addModel(terrain.zeb[1][i1]);
					gameCamera.addModel(terrain.yeb[2][i1]);
					gameCamera.addModel(terrain.zeb[2][i1]);
				}
				zoomCamera = false;
			}
		}

		if (ocb != qcb) {
			qcb = ocb;
			for (int j1 = 0; j1 < objectCount; j1++) {
				if (objectType[j1] == 51) {
					int i2 = objectX[j1];
					int j3 = objectY[j1];
					int k4 = i2 - ourPlayer.currentX / 128;
					int j6 = j3 - ourPlayer.currentY / 128;
					byte byte0 = 7;
					if (i2 >= 0 && j3 >= 0 && i2 < 96 && j3 < 96 && k4 > -byte0
							&& k4 < byte0 && j6 > -byte0 && j6 < byte0) {
						gameCamera.removeModel(objectModelArray[j1]);
						String s1 = "torcha" + (ocb + 1);
						int l10 = Cache.loadModel(s1);
						Model h1 = gameDataModels[l10].le();
						gameCamera.addModel(h1);
						h1.ne(true, 48, 48, -50, -10, -50);
						h1.vd(objectModelArray[j1]);
						h1.ph = j1;
						objectModelArray[j1] = h1;
					}
				}
				if (objectType[j1] == 143) {
					int j2 = objectX[j1];
					int k3 = objectY[j1];
					int i5 = j2 - ourPlayer.currentX / 128;
					int k6 = k3 - ourPlayer.currentY / 128;
					byte byte1 = 7;
					if (j2 >= 0 && k3 >= 0 && j2 < 96 && k3 < 96 && i5 > -byte1
							&& i5 < byte1 && k6 > -byte1 && k6 < byte1) {
						gameCamera.removeModel(objectModelArray[j1]);
						String s2 = "skulltorcha" + (ocb + 1);
						int i11 = Cache.loadModel(s2);
						Model h2 = gameDataModels[i11].le();
						gameCamera.addModel(h2);
						h2.ne(true, 48, 48, -50, -10, -50);
						h2.vd(objectModelArray[j1]);
						h2.ph = j1;
						objectModelArray[j1] = h2;
					}
				}
			}

		}
		if (pcb != rcb) {
			rcb = pcb;
			for (int k1 = 0; k1 < objectCount; k1++) {
				if (objectType[k1] == 97) {
					int k2 = objectX[k1];
					int l3 = objectY[k1];
					int j5 = k2 - ourPlayer.currentX / 128;
					int i7 = l3 - ourPlayer.currentY / 128;
					byte byte2 = 9;
					if (k2 >= 0 && l3 >= 0 && k2 < 96 && l3 < 96 && j5 > -byte2
							&& j5 < byte2 && i7 > -byte2 && i7 < byte2) {
						gameCamera.removeModel(objectModelArray[k1]);
						String s3 = "firea" + (pcb + 1);
						int j11 = Cache.loadModel(s3);
						Model h3 = gameDataModels[j11].le();
						gameCamera.addModel(h3);
						h3.ne(true, 48, 48, -50, -10, -50);
						h3.vd(objectModelArray[k1]);
						h3.ph = k1;
						objectModelArray[k1] = h3;
					}
				}
			}

		}
		gameCamera.ei(fightCount);
		fightCount = 0;
		for (int l1 = 0; l1 < playerCount; l1++) {
			Mob l2 = playerArray[l1];
			if (l2.colourBottomType != 255) {
				int i4 = l2.currentX;
				int k5 = l2.currentY;
				int j7 = -terrain.getAveragedElevation(i4, k5);
				int i9 = gameCamera.fh(5000 + l1, i4, j7, k5, 145, 220,
						l1 + 10000);
				fightCount++;
				if (l2 == ourPlayer) {
					gameCamera.gh(i9);
				}
				if (l2.currentSprite == 8) {
					gameCamera.setCombat(i9, -30);
				}
				if (l2.currentSprite == 9) {
					gameCamera.setCombat(i9, 30);
				}
			}
		}

		for (int i3 = 0; i3 < playerCount; i3++) {
			Mob l4 = playerArray[i3];
			if (l4.anInt176 > 0) {
				Mob l5 = null;
				if (l4.ds != -1) {
					l5 = npcRecordArray[l4.ds];
				} else if (l4.cs != -1) {
					l5 = mobArray[l4.cs];
				}
				if (l5 != null) {
					int k7 = l4.currentX;
					int j9 = l4.currentY;
					int j10 = -terrain.getAveragedElevation(k7, j9) - 110;
					int k11 = l5.currentX;
					int i12 = l5.currentY;
					int j12 = -terrain.getAveragedElevation(k11, i12)
							- Cache.camera2[l5.type] / 2;
					int k12 = (k7 * l4.anInt176 + k11 * (uz - l4.anInt176))
							/ uz;
					int l12 = (j10 * l4.anInt176 + j12 * (uz - l4.anInt176))
							/ uz;
					int i13 = (j9 * l4.anInt176 + i12 * (uz - l4.anInt176))
							/ uz;
					gameCamera.fh(vz + l4.bs, k12, l12, i13, 32, 32, 0);
					fightCount++;
				}
			}
		}

		for (int i = 0; i < npcCount; i++) {
			Mob mob = npcArray[i];
			int x = mob.currentX;
			int y = mob.currentY;
			int z = -terrain.getAveragedElevation(x, y);
			int l11 = gameCamera
					.fh(20000 + i, x, z, y, Cache.camera1[mob.type],
							Cache.camera2[mob.type], i + 30000);
			fightCount++;
			if (mob.currentSprite == 8) {
				gameCamera.setCombat(l11, -30);
			}
			if (mob.currentSprite == 9) {
				gameCamera.setCombat(l11, 30);
			}
		}

		for (int i6 = 0; i6 < groundItemCount; i6++) {
			int i8 = groundItemX[i6] * magicLoc + 64;
			int l9 = groundItemY[i6] * magicLoc + 64;
			gameCamera.fh(40000 + groundItemType[i6], i8,
					-terrain.getAveragedElevation(i8, l9)
							- groundItemObjectVar[i6], l9, 96, 64, i6 + 20000);
			fightCount++;
		}

		gameGraphics.rk = false;
		gameGraphics.df();
		gameGraphics.rk = super.keyF1Toggle;
		if (lastWildyYSubtract == 3) {
			int j8 = 40 + (int) (Math.random() * 3D);
			int i10 = 40 + (int) (Math.random() * 7D);
			gameCamera.th(true, j8, i10, -50, -10, -50);
		}
		bdb = 0;
		mobMessageCount = 0;
		gdb = 0;
		if (bt) {
			if (cameraAngleMode && !zoomCamera) {
				int k8 = cameraAutoAngle;
				xk();
				if (cameraAutoAngle != k8) {
					nu = ourPlayer.currentX;
					ou = ourPlayer.currentY;
				}
			}
			gameCamera.zoom1 = 3000;
			gameCamera.zoom2 = 3000;
			gameCamera.zoom3 = 1;
			gameCamera.zoom4 = 2800;
			cameraRotation = cameraAutoAngle * 32;
			gameCamera.uh(nu, -terrain.getAveragedElevation(nu, ou), ou, 912,
					cameraRotation * 4, 0, 2000);
		} else {
			if (cameraAngleMode && !zoomCamera) {
				xk();
			}
			if (!super.keyF1Toggle) {
				gameCamera.zoom1 = 2400;
				gameCamera.zoom2 = 2400;
				gameCamera.zoom3 = 1;
				gameCamera.zoom4 = 2300;
			} else {
				gameCamera.zoom1 = 2200;
				gameCamera.zoom2 = 2200;
				gameCamera.zoom3 = 1;
				gameCamera.zoom4 = 2100;
			}
			gameCamera.uh(nu, -terrain.getAveragedElevation(nu, ou), ou, 912,
					cameraRotation * 4, 0, cameraHeight * 2);
		}
		gameCamera.qi();
		nk();
		if (actionPictureType > 0) {
			gameGraphics.drawPicutre(tcb - 8, ucb - 8, az + 14
					+ (24 - actionPictureType) / 6);
		}
		if (actionPictureType < 0) {
			gameGraphics.drawPicutre(tcb - 8, ucb - 8, az + 18
					+ (24 + actionPictureType) / 6);
		}
		gameGraphics
				.drawString("Fps: " + super.xq, 450, windowHeight - 10, 1, 0xffff00);
		if (pz == 0) {
			for (int l8 = 0; l8 < qz; l8++) {
				if (sz[l8] > 0) {
					String s = rz[l8];
					gameGraphics.drawString(s, 7, windowHeight - 18 - l8 * 12, 1,
							0xffff00);
				}
			}

		}
		gameMenu.nd(lz);
		gameMenu.nd(nz);
		gameMenu.nd(oz);
		if (pz == 1) {
			gameMenu.bd(lz);
		} else if (pz == 2) {
			gameMenu.bd(nz);
		} else if (pz == 3) {
			gameMenu.bd(oz);
		}
		Menu.ig = 2;
		gameMenu.drawMenu();
		Menu.ig = 0;
		gameGraphics.vf(
				((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 197, 3, az);
		jk();
		gameGraphics.vk = false;
		drawChatMessageTabs();
		gameGraphics.drawImage(ot, 0, 11);
	}

	public void drawChatMessageTabs() {
		gameGraphics.drawPicutre(0, windowHeight - 4, az + 23);
		int i1 = GameImage.convertRGBtoLong(200, 200, 255);
		if (pz == 0) {
			i1 = GameImage.convertRGBtoLong(255, 200, 50);
		}
		if (gz % 30 > 15) {
			i1 = GameImage.convertRGBtoLong(255, 50, 50);
		}
		gameGraphics.drawText("All messages", 54, windowHeight + 6, 0, i1);
		i1 = GameImage.convertRGBtoLong(200, 200, 255);
		if (pz == 1) {
			i1 = GameImage.convertRGBtoLong(255, 200, 50);
		}
		if (hz % 30 > 15) {
			i1 = GameImage.convertRGBtoLong(255, 50, 50);
		}
		gameGraphics.drawText("Chat history", 155, windowHeight + 6, 0, i1);
		i1 = GameImage.convertRGBtoLong(200, 200, 255);
		if (pz == 2) {
			i1 = GameImage.convertRGBtoLong(255, 200, 50);
		}
		if (iz % 30 > 15) {
			i1 = GameImage.convertRGBtoLong(255, 50, 50);
		}
		gameGraphics.drawText("Quest history", 255, windowHeight + 6, 0, i1);
		i1 = GameImage.convertRGBtoLong(200, 200, 255);
		if (pz == 3) {
			i1 = GameImage.convertRGBtoLong(255, 200, 50);
		}
		if (jz % 30 > 15) {
			i1 = GameImage.convertRGBtoLong(255, 50, 50);
		}
		gameGraphics.drawText("Private history", 355, windowHeight + 6, 0, i1);
	}

	public void hk(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5,
			int arg6) {
		int i1 = Cache.ItemIDS[arg4] + nw;
		int j1 = Cache.itemPictureMask[arg4];
		gameGraphics.spriteClip4(arg0, arg1, arg2, arg3, i1, j1, 0, 0, false);
	}

	public void drawNpc(int arg0, int arg1, int arg2, int arg3, int arg4,
			int arg5, int arg6) {
		Mob mob = npcArray[arg4];
		int i1 = mob.currentSprite + (cameraRotation + 16) / 32 & 7;
		boolean flag = false;
		int j1 = i1;
		if (j1 == 5) {
			j1 = 3;
			flag = true;
		} else if (j1 == 6) {
			j1 = 2;
			flag = true;
		} else if (j1 == 7) {
			j1 = 1;
			flag = true;
		}
		int k1 = j1
				* 3
				+ walkModel[(mob.stepCount / Cache.npcWalkModels[mob.type]) % 4];
		if (mob.currentSprite == 8) {
			j1 = 5;
			byte byte0 = 2;
			flag = false;
			arg0 -= (Cache.npcCombatSprites[mob.type] * arg6) / 100;
			k1 = j1
					* 3
					+ npcCombatModelArray1[(loginTimer / (Cache.npcCombatModels[mob.type] - 1)) % 8];
		} else if (mob.currentSprite == 9) {
			j1 = 5;
			byte byte1 = 2;
			flag = true;
			arg0 += (Cache.npcCombatSprites[mob.type] * arg6) / 100;
			k1 = j1
					* 3
					+ npcCombatModelArray2[(loginTimer / Cache.npcCombatModels[mob.type]) % 8];
		}
		for (int i2 = 0; i2 < 12; i2++) {
			int j2 = npcAnimationArray[j1][i2];
			int i3 = Cache.npcSprites[mob.type][j2];
			if (i3 >= 0) {
				int k3 = 0;
				int l3 = 0;
				int i4 = k1;
				if (flag && j1 >= 1 && j1 <= 3
						&& Cache.animationNumber[i3] == 1) {
					i4 += 15;
				}
				if (j1 != 5 || Cache.xhb[i3] == 1) {
					int j4 = i4 + Cache.zhb[i3];
					k3 = (k3 * arg2) / ((GameImage) (gameGraphics)).jk[j4];
					l3 = (l3 * arg3) / ((GameImage) (gameGraphics)).kk[j4];
					int k4 = (arg2 * ((GameImage) (gameGraphics)).jk[j4])
							/ ((GameImage) (gameGraphics)).jk[Cache.zhb[i3]];
					k3 -= (k4 - arg2) / 2;
					int l4 = Cache.animationColor[i3];
					int i5 = 0;
					if (l4 == 1) {
						l4 = Cache.hhb[mob.type];
						i5 = Cache.khb[mob.type];
					} else if (l4 == 2) {
						l4 = Cache.ihb[mob.type];
						i5 = Cache.khb[mob.type];
					} else if (l4 == 3) {
						l4 = Cache.jhb[mob.type];
						i5 = Cache.khb[mob.type];
					}
					gameGraphics.spriteClip4(arg0 + k3, arg1 + l3, k4, arg3,
							j4, l4, i5, arg5, flag);
				}
			}
		}

		if (mob.lastMessageTimeout > 0) {
			mobMessagesWidth[mobMessageCount] = gameGraphics.textWidth(
					mob.lastMessage, 1) / 2;
			adb[mobMessageCount] = gameGraphics.messageFontHeight(1);
			if (mobMessagesWidth[mobMessageCount] > 300) {
				mobMessagesWidth[mobMessageCount] = 300;
				adb[mobMessageCount] *= 2;
			}
			xcb[mobMessageCount] = arg0 + arg2 / 2;
			ycb[mobMessageCount] = arg1;
			wcb[mobMessageCount++] = mob.lastMessage;
		}
		if (mob.currentSprite == 8 || mob.currentSprite == 9
				|| mob.combatTimer != 0) {
			if (mob.combatTimer > 0) {
				int k2 = arg0;
				if (mob.currentSprite == 8) {
					k2 -= (20 * arg6) / 100;
				} else if (mob.currentSprite == 9) {
					k2 += (20 * arg6) / 100;
				}
				int j3 = (mob.hitPointsCurrent * 30) / mob.hitPointsBase;
				hdb[gdb] = k2 + arg2 / 2;
				idb[gdb] = arg1;
				jdb[gdb++] = j3;
			}
			if (mob.combatTimer > 150) {
				int l2 = arg0;
				if (mob.currentSprite == 8) {
					l2 -= (10 * arg6) / 100;
				} else if (mob.currentSprite == 9) {
					l2 += (10 * arg6) / 100;
				}
				gameGraphics._mthif(l2 + arg2 / 2, arg1 + arg3 / 2, az + 12);
				gameGraphics.drawText(String.valueOf(mob.lastDamage),
						(l2 + arg2 / 2) - 1, arg1 + arg3 / 2 + 5, 3, 0xffffff);
			}
		}
	}

	public void il(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5,
			int arg6) {
		Mob l1 = playerArray[arg4];
		if (l1.colourBottomType == 255) {
			return;
		}
		int i1 = l1.currentSprite + (cameraRotation + 16) / 32 & 7;
		boolean flag = false;
		int j1 = i1;
		if (j1 == 5) {
			j1 = 3;
			flag = true;
		} else if (j1 == 6) {
			j1 = 2;
			flag = true;
		} else if (j1 == 7) {
			j1 = 1;
			flag = true;
		}
		int k1 = j1 * 3 + walkModel[(l1.stepCount / 6) % 4];
		if (l1.currentSprite == 8) {
			j1 = 5;
			i1 = 2;
			flag = false;
			arg0 -= (5 * arg6) / 100;
			k1 = j1 * 3 + npcCombatModelArray1[(loginTimer / 5) % 8];
		} else if (l1.currentSprite == 9) {
			j1 = 5;
			i1 = 2;
			flag = true;
			arg0 += (5 * arg6) / 100;
			k1 = j1 * 3 + npcCombatModelArray2[(loginTimer / 6) % 8];
		}
		for (int i2 = 0; i2 < 12; i2++) {
			int j2 = npcAnimationArray[i1][i2];
			int j3 = l1.animationCount[j2] - 1;
			if (j3 > Cache.totalEntities) {
				continue;
			}
			if (j3 >= 0) {
				int i4 = 0;
				int k4 = 0;
				int l4 = k1;
				if (flag && j1 >= 1 && j1 <= 3) {
					if (Cache.animationNumber[j3] == 1) {
						l4 += 15;
					} else if (j2 == 4 && j1 == 1) {
						i4 = -22;
						k4 = -3;
						l4 = j1 * 3 + walkModel[(2 + l1.stepCount / 6) % 4];
					} else if (j2 == 4 && j1 == 2) {
						i4 = 0;
						k4 = -8;
						l4 = j1 * 3 + walkModel[(2 + l1.stepCount / 6) % 4];
					} else if (j2 == 4 && j1 == 3) {
						i4 = 26;
						k4 = -5;
						l4 = j1 * 3 + walkModel[(2 + l1.stepCount / 6) % 4];
					} else if (j2 == 3 && j1 == 1) {
						i4 = 22;
						k4 = 3;
						l4 = j1 * 3 + walkModel[(2 + l1.stepCount / 6) % 4];
					} else if (j2 == 3 && j1 == 2) {
						i4 = 0;
						k4 = 8;
						l4 = j1 * 3 + walkModel[(2 + l1.stepCount / 6) % 4];
					} else if (j2 == 3 && j1 == 3) {
						i4 = -26;
						k4 = 5;
						l4 = j1 * 3 + walkModel[(2 + l1.stepCount / 6) % 4];
					}
				}
				if (j1 != 5 || Cache.xhb[j3] == 1) {
					int i5 = l4 + Cache.zhb[j3];
					i4 = (i4 * arg2) / ((GameImage) (gameGraphics)).jk[i5];
					k4 = (k4 * arg3) / ((GameImage) (gameGraphics)).kk[i5];
					int j5 = (arg2 * ((GameImage) (gameGraphics)).jk[i5])
							/ ((GameImage) (gameGraphics)).jk[Cache.zhb[j3]];
					i4 -= (j5 - arg2) / 2;
					int k5 = Cache.animationColor[j3];
					int l5 = 0;
					if (k5 == 1) {
						k5 = ccb[l1.colourHairType];
						l5 = dcb[l1.colourSkinType];
					} else if (k5 == 2) {
						k5 = bcb[l1.colourTopType];
						l5 = dcb[l1.colourSkinType];
					} else if (k5 == 3) {
						k5 = bcb[l1.colourBottomType];
						l5 = dcb[l1.colourSkinType];
					}
					gameGraphics.spriteClip4(arg0 + i4, arg1 + k4, j5, arg3,
							i5, k5, l5, arg5, flag);
				}
			}
		}

		if (l1.lastMessageTimeout > 0) {
			mobMessagesWidth[mobMessageCount] = gameGraphics.textWidth(l1.lastMessage,
					1) / 2;
			adb[mobMessageCount] = gameGraphics.messageFontHeight(1);
			if (mobMessagesWidth[mobMessageCount] > 300) {
				mobMessagesWidth[mobMessageCount] = 300;
				adb[mobMessageCount] *= 2;
			}
			xcb[mobMessageCount] = arg0 + arg2 / 2;
			ycb[mobMessageCount] = arg1;
			wcb[mobMessageCount++] = l1.lastMessage;
		}
		if (l1.anInt163 > 0) {
			cdb[bdb] = arg0 + arg2 / 2;
			ddb[bdb] = arg1;
			edb[bdb] = arg6;
			fdb[bdb++] = l1.anInt162;
		}
		if (l1.currentSprite == 8 || l1.currentSprite == 9
				|| l1.combatTimer != 0) {
			if (l1.combatTimer > 0) {
				int k2 = arg0;
				if (l1.currentSprite == 8) {
					k2 -= (20 * arg6) / 100;
				} else if (l1.currentSprite == 9) {
					k2 += (20 * arg6) / 100;
				}
				int k3 = (l1.hitPointsCurrent * 30) / l1.hitPointsBase;
				hdb[gdb] = k2 + arg2 / 2;
				idb[gdb] = arg1;
				jdb[gdb++] = k3;
			}
			if (l1.combatTimer > 150) {
				int l2 = arg0;
				if (l1.currentSprite == 8) {
					l2 -= (10 * arg6) / 100;
				} else if (l1.currentSprite == 9) {
					l2 += (10 * arg6) / 100;
				}
				gameGraphics._mthif(l2 + arg2 / 2, arg1 + arg3 / 2, az + 11);
				gameGraphics.drawText(String.valueOf(l1.lastDamage),
						(l2 + arg2 / 2) - 1, arg1 + arg3 / 2 + 5, 3, 0xffffff);
			}
		}
		if (l1.skulled == 1 && l1.anInt163 == 0) {
			int i3 = arg5 + arg0 + arg2 / 2;
			if (l1.currentSprite == 8) {
				i3 -= (20 * arg6) / 100;
			} else if (l1.currentSprite == 9) {
				i3 += (20 * arg6) / 100;
			}
			int l3 = (16 * arg6) / 100;
			int j4 = (16 * arg6) / 100;
			gameGraphics.spriteClip(i3 - l3 / 2, arg1 - j4 / 2 - (10 * arg6) / 100, l3,
					j4, az + 13);
		}
	}

	public void nk() {
		for (int i1 = 0; i1 < mobMessageCount; i1++) {
			int j1 = xcb[i1];
			int l1 = ycb[i1];
			int k2 = mobMessagesWidth[i1];
			int j3 = adb[i1];
			boolean flag = true;
			while (flag) {
				flag = false;
				for (int k4 = 0; k4 < i1; k4++) {
					if (l1 > ycb[k4] - adb[k4] && l1 - j3 < ycb[k4]
							&& j1 - k2 < xcb[k4] + mobMessagesWidth[k4]
							&& j1 + k2 > xcb[k4] - mobMessagesWidth[k4]) {
						l1 = ycb[k4] - j3;
						flag = true;
					}
				}

			}
			ycb[i1] = l1;
			gameGraphics.ug(wcb[i1], j1, l1, 1, 0xffff00, 300);
		}

		for (int k1 = 0; k1 < bdb; k1++) {
			int i2 = cdb[k1];
			int l2 = ddb[k1];
			int k3 = edb[k1];
			int i4 = fdb[k1];
			int l4 = (39 * k3) / 100;
			int i5 = (27 * k3) / 100;
			int j5 = l2 - i5;
			gameGraphics.wg(i2 - l4 / 2, j5, l4, i5, az + 9, 85);
			int k5 = (36 * k3) / 100;
			int l5 = (24 * k3) / 100;
			gameGraphics.spriteClip4(i2 - k5 / 2, (j5 + i5 / 2) - l5 / 2, k5,
					l5, Cache.ItemIDS[i4] + nw, Cache.itemPictureMask[i4], 0, 0, false);
		}

		for (int j2 = 0; j2 < gdb; j2++) {
			int i3 = hdb[j2];
			int l3 = idb[j2];
			int j4 = jdb[j2];
			gameGraphics.nf(i3 - 15, l3 - 3, j4, 5, 65280, 192);
			gameGraphics.nf((i3 - 15) + j4, l3 - 3, 30 - j4, 5, 0xff0000, 192);
		}

	}

	public int dk(int arg0) {
		int i1 = 0;
		for (int j1 = 0; j1 < inventoryCount; j1++) {
			if (inventoryItems[j1] == arg0) {
				if (Cache.itemStackable[arg0] == 1) {
					i1++;
				} else {
					i1 += inventoryItemsCount[j1];
				}
			}
		}

		return i1;
	}

	public boolean mk(int arg0, int arg1) {
		if (arg0 == 31 && ok(197)) {
			return true;
		}
		if (arg0 == 32 && ok(102)) {
			return true;
		}
		if (arg0 == 33 && ok(101)) {
			return true;
		}
		if (arg0 == 34 && ok(103)) {
			return true;
		}
		return dk(arg0) >= arg1;
	}

	public boolean ok(int arg0) {
		for (int i1 = 0; i1 < inventoryCount; i1++) {
			if (inventoryItems[i1] == arg0 && wearing[i1] == 1) {
				return true;
			}
		}

		return false;
	}

	public void fk(int arg0, int arg1, int arg2) {
		gameGraphics.setPixelColour(arg0, arg1, arg2);
		gameGraphics.setPixelColour(arg0 - 1, arg1, arg2);
		gameGraphics.setPixelColour(arg0 + 1, arg1, arg2);
		gameGraphics.setPixelColour(arg0, arg1 - 1, arg2);
		gameGraphics.setPixelColour(arg0, arg1 + 1, arg2);
	}

	public void ul(int arg0, int arg1, int arg2, int arg3, boolean arg4) {
		sendWalkCommand(arg0, arg1, arg2, arg3, arg2, arg3, false, arg4);
	}

	public void gl(int arg0, int arg1, int arg2, int arg3, boolean arg4) {
		if (sendWalkCommand(arg0, arg1, arg2, arg3, arg2, arg3, false, arg4)) {
			return;
		} else {
			sendWalkCommand(arg0, arg1, arg2, arg3, arg2, arg3, true, arg4);
			return;
		}
	}

	public void walkToObject(int arg0, int arg1, int arg2, int arg3) {
		int i1;
		int j1;
		if (arg2 == 0 || arg2 == 4) {
			i1 = Cache.gib[arg3];
			j1 = Cache.hib[arg3];
		} else {
			j1 = Cache.gib[arg3];
			i1 = Cache.hib[arg3];
		}
		if (Cache.iib[arg3] == 2 || Cache.iib[arg3] == 3) {
			if (arg2 == 0) {
				arg0--;
				i1++;
			}
			if (arg2 == 2) {
				j1++;
			}
			if (arg2 == 4) {
				i1++;
			}
			if (arg2 == 6) {
				arg1--;
				j1++;
			}
			sendWalkCommand(sectionX, sectionY, arg0, arg1, (arg0 + i1) - 1,
					(arg1 + j1) - 1, false, true);
			return;
		} else {
			sendWalkCommand(sectionX, sectionY, arg0, arg1, (arg0 + i1) - 1,
					(arg1 + j1) - 1, true, true);
			return;
		}
	}

	public void walkToAction(int actionX, int actionY, int actionType) {
		if (actionType == 0) {
			sendWalkCommand(sectionX, sectionY, actionX, actionY - 1, actionX,
					actionY, false, true);
			return;
		}
		if (actionType == 1) {
			sendWalkCommand(sectionX, sectionY, actionX - 1, actionY, actionX,
					actionY, false, true);
			return;
		} else {
			sendWalkCommand(sectionX, sectionY, actionX, actionY, actionX,
					actionY, true, true);
			return;
		}
	}

	public boolean sendWalkCommand(int walkSectionX, int walkSectionY,
			int arg2, int arg3, int arg4, int arg5, boolean stepBoolean,
			boolean coordsEqual) {
		int stepCount = terrain.getStepCount(walkSectionX, walkSectionY, arg2,
				arg3, arg4, arg5, sectionXArray, sectionYArray, stepBoolean);
		if (stepCount == -1) {
			if (coordsEqual) {
				stepCount = 1;
				sectionXArray[0] = arg2;
				sectionYArray[0] = arg3;
			} else {
				return false;
			}
		}
		stepCount--;
		walkSectionX = sectionXArray[stepCount];
		walkSectionY = sectionYArray[stepCount];
		stepCount--;
		if (coordsEqual) {
			super.streamClass.createPacket(215);
		} else {
			super.streamClass.createPacket(255);
		}
		super.streamClass.add2ByteInt(walkSectionX + areaX);
		super.streamClass.add2ByteInt(walkSectionY + areaY);
		if (coordsEqual && stepCount == -1 && (walkSectionX + areaX) % 5 == 0) {
			stepCount = 0;
		}
		for (int currentStep = stepCount; currentStep >= 0
				&& currentStep > stepCount - 25; currentStep--) {
			super.streamClass
					.addByte(sectionXArray[currentStep] - walkSectionX);
			super.streamClass
					.addByte(sectionYArray[currentStep] - walkSectionY);
		}
		super.streamClass.formatPacket();
		actionPictureType = -24;
		tcb = super.mouseX;
		ucb = super.mouseY;
		return true;
	}

	public boolean loadSection(int arg0, int arg1) {
		if (playerAliveTimeout != 0) {
			terrain.playerIsAlive = false;
			return false;
		}
		arg0 += wildX;
		arg1 += wildY;
		if (lastWildyYSubtract == wildYSubtract && arg0 > yu && arg0 < av
				&& arg1 > zu && arg1 < bv) {
			terrain.playerIsAlive = true;
			return false;
		}
		gameGraphics.drawText("Loading... Please wait", 256, 192, 1, 0xffffff);
		drawChatMessageTabs();
		gameGraphics.drawImage(ot, 0, 11);
		int i1 = areaX;
		int j1 = areaY;
		int k1 = (arg0 + 24) / 48;
		int l1 = (arg1 + 24) / 48;
		lastWildyYSubtract = wildYSubtract;
		areaX = k1 * 48 - 48;
		areaY = l1 * 48 - 48;
		yu = k1 * 48 - 32;
		zu = l1 * 48 - 32;
		av = k1 * 48 + 32;
		bv = l1 * 48 + 32;
		terrain.rn(arg0, arg1, lastWildyYSubtract);
		areaX -= wildX;
		areaY -= wildY;
		int i2 = areaX - i1;
		int j2 = areaY - j1;
		for (int k2 = 0; k2 < objectCount; k2++) {
			objectX[k2] -= i2;
			objectY[k2] -= j2;
			int l2 = objectX[k2];
			int j3 = objectY[k2];
			int i4 = objectType[k2];

			Model model = objectModelArray[k2];
			try {
				int j5 = objectID[k2];

				int j6;
				int i7;
				if (j5 == 0 || j5 == 4) {
					j6 = Cache.gib[i4];
					i7 = Cache.hib[i4];
				} else {
					i7 = Cache.gib[i4];
					j6 = Cache.hib[i4];
				}
				int j7 = ((l2 + l2 + j6) * magicLoc) / 2;
				int k7 = ((j3 + j3 + i7) * magicLoc) / 2;
				if (l2 >= 0 && j3 >= 0 && l2 < 96 && j3 < 96) {
					gameCamera.addModel(model);
					model.ce(j7, -terrain.getAveragedElevation(j7, k7), k7);
					terrain.pn(l2, j3, i4);
					if (i4 == 74) {
						model.wd(0, -480, 0);
					}
				}
			} catch (RuntimeException runtimeexception) {
				runtimeexception.printStackTrace();
			}
		}

		for (int i3 = 0; i3 < doorCount; i3++) {
			doorX[i3] -= i2;
			doorY[i3] -= j2;
			int k3 = doorX[i3];
			int j4 = doorY[i3];
			int l4 = doorType[i3];
			int k5 = doorDirection[i3];
			try {
				terrain.bo(k3, j4, k5, l4);
				Model h2 = makeModel(k3, j4, k5, l4, i3);
				doorModel[i3] = h2;
			} catch (RuntimeException runtimeexception1) {
				System.out.println("Bound Error: "
						+ runtimeexception1.getMessage());
				runtimeexception1.printStackTrace();
			}
		}

		for (int l3 = 0; l3 < groundItemCount; l3++) {
			groundItemX[l3] -= i2;
			groundItemY[l3] -= j2;
		}

		for (int k4 = 0; k4 < playerCount; k4++) {
			Mob mob = playerArray[k4];
			mob.currentX -= i2 * magicLoc;
			mob.currentY -= j2 * magicLoc;
			for (int i6 = 0; i6 < mob.waypointCurrent; i6++) {
				mob.waypointsX[i6] -= i2 * magicLoc;
				mob.waypointsY[i6] -= j2 * magicLoc;
			}

		}

		for (int loop = 0; loop < npcCount; loop++) {
			Mob mob_1 = npcArray[loop];
			mob_1.currentX -= i2 * magicLoc;
			mob_1.currentY -= j2 * magicLoc;
			for (int loop_2 = 0; loop_2 < mob_1.waypointCurrent; loop_2++) {
				mob_1.waypointsX[loop_2] -= i2 * magicLoc;
				mob_1.waypointsY[loop_2] -= j2 * magicLoc;
			}

		}

		terrain.playerIsAlive = true;
		hu = false;
		return true;
	}

	public Model makeModel(int arg0, int arg1, int arg2, int arg3, int arg4) {
		int i1 = arg0;
		int j1 = arg1;
		int k1 = arg0;
		int l1 = arg1;
		int i2 = Cache.rib[arg3];
		int j2 = Cache.sib[arg3];
		int k2 = Cache.qib[arg3];
		Model h1 = new Model(4, 1);
		if (arg2 == 0) {
			k1 = arg0 + 1;
		}
		if (arg2 == 1) {
			l1 = arg1 + 1;
		}
		if (arg2 == 2) {
			i1 = arg0 + 1;
			l1 = arg1 + 1;
		}
		if (arg2 == 3) {
			k1 = arg0 + 1;
			l1 = arg1 + 1;
		}
		i1 *= magicLoc;
		j1 *= magicLoc;
		k1 *= magicLoc;
		l1 *= magicLoc;
		int l2 = h1.je(i1, -terrain.getAveragedElevation(i1, j1), j1);
		int i3 = h1.je(i1, -terrain.getAveragedElevation(i1, j1) - k2, j1);
		int j3 = h1.je(k1, -terrain.getAveragedElevation(k1, l1) - k2, l1);
		int k3 = h1.je(k1, -terrain.getAveragedElevation(k1, l1), l1);
		int ai[] = { l2, i3, j3, k3 };
		h1.ie(4, ai, i2, j2);
		h1.ne(false, 60, 24, -50, -10, -50);
		if (arg0 >= 0 && arg1 >= 0 && arg0 < 96 && arg1 < 96) {
			gameCamera.addModel(h1);
		}
		h1.ph = arg4 + 10000;
		return h1;
	}

	public void jk() {
		if (showShopWindow && lastDeath == 0) {
			rk();
		} else if (showTradeWindow) {
			drawTradeWindow();
		} else if (gt != 0) {
			kk();
		} else if (ht != 0) {
			cm();
		} else if (ft == 1) {
			gm();
		} else if (!kt && jt > 0x2bf20 && lastDeath == 0) {
			el();
		} else {
			if (showQuestionMenu) {
				nl();
			}
			if (ourPlayer.combatTimer > 0) {
				ql();
			}
			pk();
			boolean flag = !showQuestionMenu && !dv;
			if (flag) {
				menuLength = 0;
			}
			if (nx == 0 && flag) {
				tk();
			}
			if (nx == 1) {
				wl(flag);
			}
			if (nx == 2) {
				vk(flag);
			}
			if (nx == 3) {
				drawSkillsMenu(flag);
			}
			if (nx == 4) {
				drawMagicPrayerMenu(flag);
			}
			if (nx == 5) {
				tl(flag);
			}
			if (nx == 6) {
				kl(flag);
			}
			if (!dv && !showQuestionMenu) {
				fm();
			}
			if (dv && !showQuestionMenu) {
				am();
			}
		}
		mx = 0;
	}

	public void nl() {
		if (mx != 0) {
			for (int i1 = 0; i1 < questionMenuCount; i1++) {
				if (super.mouseX >= gameGraphics.textWidth(questionMenuAnswer[i1], 1)
						|| super.mouseY <= i1 * 12 || super.mouseY >= 12 + i1 * 12) {
					continue;
				}
				super.streamClass.createPacket(237);
				super.streamClass.addByte(i1);
				sendPacket();
				break;
			}

			mx = 0;
			showQuestionMenu = false;
			return;
		}
		for (int j1 = 0; j1 < questionMenuCount; j1++) {
			int k1 = 65535;
			if (super.mouseX < gameGraphics.textWidth(questionMenuAnswer[j1], 1)
					&& super.mouseY > j1 * 12 && super.mouseY < 12 + j1 * 12) {
				k1 = 0xff0000;
			}
			gameGraphics.drawString(questionMenuAnswer[j1], 6, 12 + j1 * 12, 1, k1);
		}

	}

	public void ql() {
		byte byte0 = 7;
		byte byte1 = 15;
		char c1 = '\257';
		if (mx != 0) {
			for (int i1 = 0; i1 < 5; i1++) {
				if (i1 <= 0 || super.mouseX <= byte0 || super.mouseX >= byte0 + c1
						|| super.mouseY <= byte1 + i1 * 20
						|| super.mouseY >= byte1 + i1 * 20 + 20) {
					continue;
				}
				combatStyle = i1 - 1;
				mx = 0;
				super.streamClass.createPacket(231);
				super.streamClass.addByte(combatStyle);
				sendPacket();
				break;
			}

		}
		for (int j1 = 0; j1 < 5; j1++) {
			if (j1 == combatStyle + 1) {
				gameGraphics.nf(byte0, byte1 + j1 * 20, c1, 20,
						GameImage.convertRGBtoLong(255, 0, 0), 128);
			} else {
				gameGraphics.nf(byte0, byte1 + j1 * 20, c1, 20,
						GameImage.convertRGBtoLong(190, 190, 190), 128);
			}
			gameGraphics.drawLineX(byte0, byte1 + j1 * 20, c1, 0);
			gameGraphics.drawLineX(byte0, byte1 + j1 * 20 + 20, c1, 0);
		}

		gameGraphics.drawText("Select combat style", byte0 + c1 / 2,
				byte1 + 16, 3, 0xffffff);
		gameGraphics.drawText("Controlled (+1 of each)", byte0 + c1 / 2,
				byte1 + 36, 3, 0);
		gameGraphics.drawText("Aggressive (+3 strength)", byte0 + c1 / 2,
				byte1 + 56, 3, 0);
		gameGraphics.drawText("Accurate   (+3 attack)", byte0 + c1 / 2,
				byte1 + 76, 3, 0);
		gameGraphics.drawText("Defensive  (+3 defense)", byte0 + c1 / 2,
				byte1 + 96, 3, 0);
	}

	public void el() {
		if (mx != 0) {
			mx = 0;
			if (super.mouseX > 200 && super.mouseX < 300 && super.mouseY > 230
					&& super.mouseY < 253) {
				kt = true;
				return;
			}
		}
		int i1 = 90;
		gameGraphics.drawBox(106, 70, 300, 190, 0);
		gameGraphics.drawBoxEdge(106, 70, 300, 190, 0xffffff);
		gameGraphics
				.drawText("You have been playing for", 256, i1, 4, 0xffffff);
		i1 += 20;
		gameGraphics.drawText("over 1 hour. Please consider", 256, i1, 4,
				0xffffff);
		i1 += 20;
		gameGraphics.drawText("visiting our advertiser if you", 256, i1, 4,
				0xffffff);
		i1 += 20;
		gameGraphics.drawText("see an advert which interests you.", 256, i1, 4,
				0xffffff);
		i1 += 40;
		gameGraphics
				.drawText("Doing so will help ensure", 256, i1, 4, 0xffffff);
		i1 += 20;
		gameGraphics.drawText("Runescape remains free.", 256, i1, 4, 0xffffff);
		i1 += 40;
		int j1 = 0xffffff;
		if (super.mouseX > 200 && super.mouseX < 300 && super.mouseY > i1 - 20
				&& super.mouseY < i1 + 3) {
			j1 = 0xffff00;
		}
		gameGraphics.drawText("Close", 256, i1, 4, j1);
	}

	public void gm() {
		if (mx != 0) {
			mx = 0;
			char c1 = '\372';
			if (super.mouseX < 56 || super.mouseY < 70 || super.mouseX > 456
					|| super.mouseY > 260) {
				ft = 0;
				return;
			}
			if (super.mouseX > 250 && super.mouseX < 350 && super.mouseY > c1 - 20
					&& super.mouseY < c1 + 3) {
				ft = 0;
				return;
			}
			if (super.mouseX > 150 && super.mouseX < 250 && super.mouseY > c1 - 20
					&& super.mouseY < c1 + 3) {
				playerKiller = !playerKiller;
				super.streamClass.createPacket(213);
				super.streamClass.addByte(1);
				super.streamClass.addByte(playerKiller ? 1 : 0);
				super.streamClass.formatPacket();
				ft = 0;
				return;
			}
		}
		gameGraphics.drawBox(56, 70, 400, 190, 0);
		gameGraphics.drawBoxEdge(56, 70, 400, 190, 0xffffff);
		int i1 = 90;
		if (!playerKiller) {
			gameGraphics.drawText("Are you sure you want to change", 256, i1,
					4, 0xffffff);
			i1 += 20;
			gameGraphics.drawText("to being able to fight other players?", 256,
					i1, 4, 0xffffff);
			i1 += 40;
			gameGraphics.drawText("If you do other players will be able to",
					256, i1, 4, 0xffffff);
			i1 += 20;
			gameGraphics.drawText("attack you, and you will probably die", 256,
					i1, 4, 0xffffff);
			i1 += 20;
			gameGraphics.drawText("much more often.", 256, i1, 4, 0xffffff);
			i1 += 40;
		}
		if (playerKiller) {
			gameGraphics.drawText("Are you sure you want to change", 256, i1,
					4, 0xffffff);
			i1 += 20;
			gameGraphics.drawText("to not fighting other players?", 256, i1, 4,
					0xffffff);
			i1 += 40;
			gameGraphics.drawText("This will make you safe from attack,", 256,
					i1, 4, 0xffffff);
			i1 += 20;
			gameGraphics.drawText(
					"but will also preventing you from attacking", 256, i1, 4,
					0xffffff);
			i1 += 20;
			gameGraphics.drawText("others (except in the arena - coming soon)",
					256, i1, 4, 0xffffff);
			i1 += 40;
		}
		if (pvpChangeAvaible == 2) {
			gameGraphics.drawText("You can only change a total of 2 times",
					256, i1, 4, 0xffffff);
			i1 += 20;
		}
		if (pvpChangeAvaible == 1) {
			gameGraphics.drawText(
					"You will not be allowed to change back again", 256, i1, 4,
					0xffffff);
			i1 += 20;
		}
		i1 = 250;
		int j1 = 0xffffff;
		if (super.mouseX > 150 && super.mouseX < 250 && super.mouseY > i1 - 20
				&& super.mouseY < i1 + 3) {
			j1 = 0xffff00;
		}
		gameGraphics.drawText("Yes I'm sure", 200, i1, 4, j1);
		j1 = 0xffffff;
		if (super.mouseX > 250 && super.mouseX < 350 && super.mouseY > i1 - 20
				&& super.mouseY < i1 + 3) {
			j1 = 0xffff00;
		}
		gameGraphics.drawText("No thanks", 300, i1, 4, j1);
	}

	public void kk() {
		if (mx != 0) {
			mx = 0;
			if (super.mouseX < 106 || super.mouseY < 150 || super.mouseX > 406
					|| super.mouseY > 210) {
				gt = 0;
				return;
			}
		}
		int i1 = 150;
		gameGraphics.drawBox(106, i1, 300, 60, 0);
		gameGraphics.drawBoxEdge(106, i1, 300, 60, 0xffffff);
		i1 += 22;
		if (gt == 1) {
			gameGraphics.drawText("Please enter your new password", 256, i1, 4,
					0xffffff);
			i1 += 25;
			String s = "*";
			for (int j1 = 0; j1 < super.inputText.length(); j1++) {
				s = "X" + s;
			}

			gameGraphics.drawText(s, 256, i1, 4, 0xffffff);
			if (super.enteredText.length() > 0) {
				it = super.enteredText;
				super.inputText = "";
				super.enteredText = "";
				gt = 2;
				return;
			}
		} else if (gt == 2) {
			gameGraphics.drawText("Enter password again to confirm", 256, i1,
					4, 0xffffff);
			i1 += 25;
			String s1 = "*";
			for (int k1 = 0; k1 < super.inputText.length(); k1++) {
				s1 = "X" + s1;
			}

			gameGraphics.drawText(s1, 256, i1, 4, 0xffffff);
			if (super.enteredText.length() > 0) {
				if (super.enteredText.equalsIgnoreCase(it)) {
					gt = 4;
					ab(it);
					return;
				} else {
					gt = 3;
					return;
				}
			}
		} else {
			if (gt == 3) {
				gameGraphics.drawText("Passwords do not match!", 256, i1, 4,
						0xffffff);
				i1 += 25;
				gameGraphics.drawText("Press any key to close", 256, i1, 4,
						0xffffff);
				return;
			}
			if (gt == 4) {
				gameGraphics.drawText("Ok, your request has been sent", 256,
						i1, 4, 0xffffff);
				i1 += 25;
				gameGraphics.drawText("Press any key to close", 256, i1, 4,
						0xffffff);
			}
		}
	}

	public void cm() {
		if (mx != 0) {
			mx = 0;
			if (ht == 1
					&& (super.mouseX < 106 || super.mouseY < 145 || super.mouseX > 406 || super.mouseY > 215)) {
				ht = 0;
				return;
			}
			if (ht == 2
					&& (super.mouseX < 6 || super.mouseY < 145 || super.mouseX > 506 || super.mouseY > 215)) {
				ht = 0;
				return;
			}
			if (ht == 3
					&& (super.mouseX < 106 || super.mouseY < 145 || super.mouseX > 406 || super.mouseY > 215)) {
				ht = 0;
				return;
			}
			if (super.mouseX > 236 && super.mouseX < 276 && super.mouseY > 193
					&& super.mouseY < 213) {
				ht = 0;
				return;
			}
		}
		int i1 = 145;
		if (ht == 1) {
			gameGraphics.drawBox(106, i1, 300, 70, 0);
			gameGraphics.drawBoxEdge(106, i1, 300, 70, 0xffffff);
			i1 += 20;
			gameGraphics.drawText("Enter name to add to friends list", 256, i1,
					4, 0xffffff);
			i1 += 20;
			gameGraphics.drawText(super.inputText + "*", 256, i1, 4, 0xffffff);
			if (super.enteredText.length() > 0) {
				String s = super.enteredText.trim();
				super.inputText = "";
				super.enteredText = "";
				ht = 0;
				if (s.length() > 0
						&& DataOperations.stringLength12ToLong(s) != ourPlayer.nameLong) {
					gb(s);
				}
			}
		}
		if (ht == 2) {
			gameGraphics.drawBox(6, i1, 500, 70, 0);
			gameGraphics.drawBoxEdge(6, i1, 500, 70, 0xffffff);
			i1 += 20;
			gameGraphics.drawText(
					"Enter message to send to "
							+ DataOperations.longToString(kcb), 256, i1, 4,
					0xffffff);
			i1 += 20;
			gameGraphics.drawText(super.inputMessage + "*", 256, i1, 4, 0xffffff);
			if (super.enteredMessage.length() > 0) {
				String s1 = super.enteredMessage;
				super.inputMessage = "";
				super.enteredMessage = "";
				ht = 0;
				privateMessage(kcb, s1);
			}
		}
		if (ht == 3) {
			gameGraphics.drawBox(106, i1, 300, 70, 0);
			gameGraphics.drawBoxEdge(106, i1, 300, 70, 0xffffff);
			i1 += 20;
			gameGraphics.drawText("Enter name to add to ignore list", 256, i1,
					4, 0xffffff);
			i1 += 20;
			gameGraphics.drawText(super.inputText + "*", 256, i1, 4, 0xffffff);
			if (super.enteredText.length() > 0) {
				String s2 = super.enteredText.trim();
				super.inputText = "";
				super.enteredText = "";
				ht = 0;
				if (s2.length() > 0
						&& DataOperations.stringLength12ToLong(s2) != ourPlayer.nameLong) {
					lb(s2);
				}
			}
		}
		int j1 = 0xffffff;
		if (super.mouseX > 236 && super.mouseX < 276 && super.mouseY > 193
				&& super.mouseY < 213) {
			j1 = 0xffff00;
		}
		gameGraphics.drawText("Cancel", 256, 208, 1, j1);
	}

	public void rk() {
		if (mx != 0) {
			mx = 0;
			int i1 = super.mouseX - 52;
			int j1 = super.mouseY - 44;
			if (i1 >= 0 && j1 >= 12 && i1 < 408 && j1 < 246) {
				int k1 = 0;
				for (int i2 = 0; i2 < 5; i2++) {
					for (int i3 = 0; i3 < 8; i3++) {
						int l3 = 7 + i3 * 49;
						int l4 = 28 + i2 * 34;
						if (i1 > l3 && i1 < l3 + 49 && j1 > l4 && j1 < l4 + 34
								&& shopItemIDs[k1] != -1) {
							my = k1;
							ny = shopItemIDs[k1];
						}
						k1++;
					}

				}

				if (my >= 0) {
					int j3 = shopItemIDs[my];
					if (j3 != -1) {
						if (shopItemAmounts[my] > 0 && i1 > 298 && j1 >= 204
								&& i1 < 408 && j1 <= 215) {
							int i4 = showBuyModifier + ly[my];
							if (i4 < 10) {
								i4 = 10;
							}
							int i5 = (i4 * Cache.itemPrice[j3]) / 100;
							super.streamClass.createPacket(217);
							super.streamClass.add2ByteInt(shopItemIDs[my]);
							super.streamClass.add2ByteInt(i5);
							sendPacket();
						}
						if (dk(j3) > 0 && i1 > 2 && j1 >= 229 && i1 < 112
								&& j1 <= 240) {
							int j4 = shopSellModifier + ly[my];
							if (j4 < 10) {
								j4 = 10;
							}
							int j5 = (j4 * Cache.itemPrice[j3]) / 100;
							super.streamClass.createPacket(216);
							super.streamClass.add2ByteInt(shopItemIDs[my]);
							super.streamClass.add2ByteInt(j5);
							sendPacket();
						}
					}
				}
			} else {
				super.streamClass.createPacket(218);
				sendPacket();
				showShopWindow = false;
				return;
			}
		}
		byte byte0 = 52;
		byte byte1 = 44;
		gameGraphics.drawBox(byte0, byte1, 408, 12, 192);
		int l1 = 0x989898;
		gameGraphics.nf(byte0, byte1 + 12, 408, 17, l1, 160);
		gameGraphics.nf(byte0, byte1 + 29, 8, 170, l1, 160);
		gameGraphics.nf(byte0 + 399, byte1 + 29, 9, 170, l1, 160);
		gameGraphics.nf(byte0, byte1 + 199, 408, 47, l1, 160);
		gameGraphics.drawString("Buying and selling items", byte0 + 1, byte1 + 10, 1,
				0xffffff);
		int j2 = 0xffffff;
		if (super.mouseX > byte0 + 320 && super.mouseY >= byte1
				&& super.mouseX < byte0 + 408 && super.mouseY < byte1 + 12) {
			j2 = 0xff0000;
		}
		gameGraphics.sg("Close window", byte0 + 406, byte1 + 10, 1, j2);
		gameGraphics
				.drawString("Shops stock in green", byte0 + 2, byte1 + 24, 1, 65280);
		gameGraphics.drawString("Number you own in blue", byte0 + 135, byte1 + 24, 1,
				65535);
		gameGraphics.drawString("Your money: " + dk(10) + "gp", byte0 + 280,
				byte1 + 24, 1, 0xffff00);
		int k3 = 0xd0d0d0;
		int k4 = 0;
		for (int k5 = 0; k5 < 5; k5++) {
			for (int l5 = 0; l5 < 8; l5++) {
				int j6 = byte0 + 7 + l5 * 49;
				int i7 = byte1 + 28 + k5 * 34;
				if (my == k4) {
					gameGraphics.nf(j6, i7, 49, 34, 0xff0000, 160);
				} else {
					gameGraphics.nf(j6, i7, 49, 34, k3, 160);
				}
				gameGraphics.drawBoxEdge(j6, i7, 50, 35, 0);
				if (shopItemIDs[k4] != -1) {
					gameGraphics.spriteClip4(j6, i7, 48, 32, nw
							+ Cache.ItemIDS[shopItemIDs[k4]],
							Cache.itemPictureMask[shopItemIDs[k4]], 0, 0, false);
					gameGraphics.drawString(String.valueOf(shopItemAmounts[k4]),
							j6 + 1, i7 + 10, 1, 65280);
					gameGraphics.sg(String.valueOf(dk(shopItemIDs[k4])),
							j6 + 47, i7 + 10, 1, 65535);
				}
				k4++;
			}

		}

		gameGraphics.drawLineX(byte0 + 5, byte1 + 222, 398, 0);
		if (my == -1) {
			gameGraphics.drawText("Select an object to buy or sell",
					byte0 + 204, byte1 + 214, 3, 0xffff00);
			return;
		}
		int i6 = shopItemIDs[my];
		if (i6 != -1) {
			if (shopItemAmounts[my] > 0) {
				int k6 = showBuyModifier + ly[my];
				if (k6 < 10) {
					k6 = 10;
				}
				int j7 = (k6 * Cache.itemPrice[i6]) / 100;
				gameGraphics.drawString("Buy a new " + Cache.itemNames[i6][0]
						+ " for " + j7 + "gp", byte0 + 2, byte1 + 214, 1,
						0xffff00);
				int k2 = 0xffffff;
				if (super.mouseX > byte0 + 298 && super.mouseY >= byte1 + 204
						&& super.mouseX < byte0 + 408 && super.mouseY <= byte1 + 215) {
					k2 = 0xff0000;
				}
				gameGraphics.sg("Click here to buy", byte0 + 405, byte1 + 214,
						3, k2);
			} else {
				gameGraphics.drawText(
						"This item is not currently available to buy",
						byte0 + 204, byte1 + 214, 3, 0xffff00);
			}
			if (dk(i6) > 0) {
				int l6 = shopSellModifier + ly[my];
				if (l6 < 10) {
					l6 = 10;
				}
				int k7 = (l6 * Cache.itemPrice[i6]) / 100;
				gameGraphics.sg("Sell your " + Cache.itemNames[i6][0]
						+ " for " + k7 + "gp", byte0 + 405, byte1 + 239, 1,
						0xffff00);
				int l2 = 0xffffff;
				if (super.mouseX > byte0 + 2 && super.mouseY >= byte1 + 229
						&& super.mouseX < byte0 + 112 && super.mouseY <= byte1 + 240) {
					l2 = 0xff0000;
				}
				gameGraphics.drawString("Click here to sell", byte0 + 2, byte1 + 239,
						3, l2);
				return;
			}
			gameGraphics.drawText("You do not have any of this item to sell",
					byte0 + 204, byte1 + 239, 3, 0xffff00);
		}
	}

	public void drawTradeWindow() {
		if (mx != 0 && fy == 0) {
			fy = 1;
		}
		if (fy > 0) {
			int i1 = super.mouseX - 22;
			int j1 = super.mouseY - 36;
			if (i1 >= 0 && j1 >= 0 && i1 < 468 && j1 < 262) {
				if (i1 > 216 && j1 > 30 && i1 < 462 && j1 < 235) {
					int k1 = (i1 - 217) / 49 + ((j1 - 31) / 34) * 5;
					if (k1 >= 0 && k1 < inventoryCount) {
						boolean flag = false;
						int l2 = 0;
						int k3 = inventoryItems[k1];
						for (int k4 = 0; k4 < tradeMyItemCount; k4++) {
							if (offeredItemID[k4] == k3) {
								if (Cache.itemStackable[k3] == 0) {
									for (int i5 = 0; i5 < fy; i5++) {
										if (offeredItemAmount[k4] < inventoryItemsCount[k1]) {
											offeredItemAmount[k4]++;
										}
										flag = true;
									}

								} else {
									l2++;
								}
							}
						}

						if (dk(k3) <= l2) {
							flag = true;
						}
						if (!flag && tradeMyItemCount < 12) {
							offeredItemID[tradeMyItemCount] = k3;
							offeredItemAmount[tradeMyItemCount] = 1;
							tradeMyItemCount++;
							flag = true;
						}
						if (flag) {
							super.streamClass.createPacket(234);
							super.streamClass.add2ByteInt(tradeMyItemCount);
							for (int trade_loop = 0; trade_loop < tradeMyItemCount; trade_loop++) {
								super.streamClass
										.add2ByteInt(offeredItemID[trade_loop]);
								super.streamClass
										.add2ByteInt(offeredItemAmount[trade_loop]);
							}
							sendPacket();
							tradeOtherAccepted = false;
							tradeWeAccepted = false;
						}
					}
				}
				if (i1 > 8 && j1 > 30 && i1 < 205 && j1 < 133) {
					int l1 = (i1 - 9) / 49 + ((j1 - 31) / 34) * 4;
					if (l1 >= 0 && l1 < tradeMyItemCount) {
						int j2 = offeredItemID[l1];
						for (int i3 = 0; i3 < fy; i3++) {
							if (Cache.itemStackable[j2] == 0
									&& offeredItemAmount[l1] > 1) {
								offeredItemAmount[l1]--;
								continue;
							}
							tradeMyItemCount--;
							ey = 0;
							for (int l3 = l1; l3 < tradeMyItemCount; l3++) {
								offeredItemID[l3] = offeredItemID[l3 + 1];
								offeredItemAmount[l3] = offeredItemAmount[l3 + 1];
							}
							break;
						}

						super.streamClass.createPacket(234);
						super.streamClass.add2ByteInt(tradeMyItemCount);
						for (int trade_loop = 0; trade_loop < tradeMyItemCount; trade_loop++) {
							super.streamClass
									.add2ByteInt(offeredItemID[trade_loop]);
							super.streamClass
									.add2ByteInt(offeredItemAmount[trade_loop]);
						}

						sendPacket();
						tradeOtherAccepted = false;
						tradeWeAccepted = false;
					}
				}
				if (i1 > 143 && j1 > 141 && i1 < 154 && j1 < 152) {
					tradeWeAccepted = !tradeWeAccepted;
					super.streamClass.createPacket(232);
					super.streamClass.addByte(tradeWeAccepted ? 1 : 0);
					sendPacket();
				}
				if (i1 > 413 && j1 > 237 && i1 < 462 && j1 < 258) {
					showTradeWindow = false;
					super.streamClass.createPacket(233);
					sendPacket();
				}
			} else if (mx != 0) {
				showTradeWindow = false;
				super.streamClass.createPacket(233);
				sendPacket();
			}
			mx = 0;
			fy = 0;
		}
		if (!showTradeWindow) {
			return;
		}
		byte byte0 = 22;
		byte byte1 = 36;
		gameGraphics.drawBox(byte0, byte1, 468, 12, 192);
		int i2 = 0x989898;
		gameGraphics.nf(byte0, byte1 + 12, 468, 18, i2, 160);
		gameGraphics.nf(byte0, byte1 + 30, 8, 248, i2, 160);
		gameGraphics.nf(byte0 + 205, byte1 + 30, 11, 248, i2, 160);
		gameGraphics.nf(byte0 + 462, byte1 + 30, 6, 248, i2, 160);
		gameGraphics.nf(byte0 + 8, byte1 + 133, 197, 22, i2, 160);
		gameGraphics.nf(byte0 + 8, byte1 + 258, 197, 20, i2, 160);
		gameGraphics.nf(byte0 + 216, byte1 + 235, 246, 43, i2, 160);
		int k2 = 0xd0d0d0;
		gameGraphics.nf(byte0 + 8, byte1 + 30, 197, 103, k2, 160);
		gameGraphics.nf(byte0 + 8, byte1 + 155, 197, 103, k2, 160);
		gameGraphics.nf(byte0 + 216, byte1 + 30, 246, 205, k2, 160);
		for (int j3 = 0; j3 < 4; j3++) {
			gameGraphics.drawLineX(byte0 + 8, byte1 + 30 + j3 * 34, 197, 0);
		}

		for (int j4 = 0; j4 < 4; j4++) {
			gameGraphics.drawLineX(byte0 + 8, byte1 + 155 + j4 * 34, 197, 0);
		}

		for (int l4 = 0; l4 < 7; l4++) {
			gameGraphics.drawLineX(byte0 + 216, byte1 + 30 + l4 * 34, 246, 0);
		}

		for (int k5 = 0; k5 < 6; k5++) {
			if (k5 < 5) {
				gameGraphics.drawLineY(byte0 + 8 + k5 * 49, byte1 + 30, 103, 0);
			}
			if (k5 < 5) {
				gameGraphics
						.drawLineY(byte0 + 8 + k5 * 49, byte1 + 155, 103, 0);
			}
			gameGraphics.drawLineY(byte0 + 216 + k5 * 49, byte1 + 30, 205, 0);
		}

		gameGraphics.drawString("Trading with: " + tradeOtherPlayerName, byte0 + 1,
				byte1 + 10, 1, 0xffffff);
		gameGraphics.drawString("Your Offer", byte0 + 9, byte1 + 27, 4, 0xffffff);
		gameGraphics
				.drawString("Opponent's Offer", byte0 + 9, byte1 + 152, 4, 0xffffff);
		gameGraphics.drawString("Your Inventory", byte0 + 216, byte1 + 27, 4, 0xffffff);
		gameGraphics.sg("Accepted", byte0 + 204, byte1 + 27, 4, 65280);
		gameGraphics.drawBoxEdge(byte0 + 125, byte1 + 16, 11, 11, 65280);
		if (tradeOtherAccepted) {
			gameGraphics.drawBox(byte0 + 127, byte1 + 18, 7, 7, 65280);
		}
		gameGraphics.sg("Accept", byte0 + 204, byte1 + 152, 4, 65280);
		gameGraphics.drawBoxEdge(byte0 + 143, byte1 + 141, 11, 11, 65280);
		if (tradeWeAccepted) {
			gameGraphics.drawBox(byte0 + 145, byte1 + 143, 7, 7, 65280);
		}
		gameGraphics.sg("Close", byte0 + 408 + 49, byte1 + 251, 4, 0xc00000);
		gameGraphics.drawBoxEdge(byte0 + 364 + 49, byte1 + 237, 49, 21,
				0xc00000);
		try {
			for (int l5 = 0; l5 < inventoryCount; l5++) {
				int i6 = 217 + byte0 + (l5 % 5) * 49;
				int k6 = 31 + byte1 + (l5 / 5) * 34;
				gameGraphics.spriteClip4(i6, k6, 48, 32, nw
						+ Cache.ItemIDS[inventoryItems[l5]],
						Cache.itemPictureMask[inventoryItems[l5]], 0, 0, false);
				if (Cache.itemStackable[inventoryItems[l5]] == 0) {
					gameGraphics.drawString(String.valueOf(inventoryItemsCount[l5]),
							i6 + 1, k6 + 10, 1, 0xffff00);
				}
			}
		} catch (ArrayIndexOutOfBoundsException e) {
			e.printStackTrace();
		}

		for (int j6 = 0; j6 < tradeMyItemCount; j6++) {
			int l6 = 9 + byte0 + (j6 % 4) * 49;
			int j7 = 31 + byte1 + (j6 / 4) * 34;
			gameGraphics.spriteClip4(l6, j7, 48, 32, nw
					+ Cache.ItemIDS[offeredItemID[j6]],
					Cache.itemPictureMask[offeredItemID[j6]], 0, 0, false);
			if (Cache.itemStackable[offeredItemID[j6]] == 0) {
				gameGraphics.drawString(String.valueOf(offeredItemAmount[j6]), l6 + 1,
						j7 + 10, 1, 0xffff00);
			}
			if (super.mouseX > l6 && super.mouseX < l6 + 48 && super.mouseY > j7
					&& super.mouseY < j7 + 32) {
				gameGraphics.drawString(Cache.itemNames[offeredItemID[j6]][0]
						+ ": @whi@" + Cache.itemExamine[offeredItemID[j6]],
						byte0 + 8, byte1 + 273, 1, 0xffff00);
			}
		}

		for (int i7 = 0; i7 < tradeOtherItemCount; i7++) {
			int k7 = 9 + byte0 + (i7 % 4) * 49;
			int l7 = 156 + byte1 + (i7 / 4) * 34;
			gameGraphics.spriteClip4(k7, l7, 48, 32, nw
					+ Cache.ItemIDS[tradeOtherItems[i7]],
					Cache.itemPictureMask[tradeOtherItems[i7]], 0, 0, false);
			if (Cache.itemStackable[tradeOtherItems[i7]] == 0) {
				gameGraphics.drawString(String.valueOf(tradeOtherAmount[i7]), k7 + 1,
						l7 + 10, 1, 0xffff00);
			}
			if (super.mouseX > k7 && super.mouseX < k7 + 48 && super.mouseY > l7
					&& super.mouseY < l7 + 32) {
				gameGraphics.drawString(Cache.itemNames[tradeOtherItems[i7]][0]
						+ ": @whi@" + Cache.itemExamine[tradeOtherItems[i7]],
						byte0 + 8, byte1 + 273, 1, 0xffff00);
			}
		}

	}

	public void pk() {
		if (nx == 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3
				&& super.mouseY < 35) {
			nx = 1;
		}
		if (nx == 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 33
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 33
				&& super.mouseY < 35) {
			nx = 2;
		}
		if (nx == 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 66
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 66
				&& super.mouseY < 35) {
			nx = 3;
		}
		if (nx == 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 99
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 99
				&& super.mouseY < 35) {
			nx = 4;
		}
		if (nx == 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 132
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 132
				&& super.mouseY < 35) {
			nx = 5;
		}
		if (nx == 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 165
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 165
				&& super.mouseY < 35) {
			nx = 6;
		}
		if (nx != 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3
				&& super.mouseY < 26) {
			nx = 1;
		}
		if (nx != 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 33
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 33
				&& super.mouseY < 26) {
			nx = 2;
		}
		if (nx != 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 66
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 66
				&& super.mouseY < 26) {
			nx = 3;
		}
		if (nx != 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 99
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 99
				&& super.mouseY < 26) {
			nx = 4;
		}
		if (nx != 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 132
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 132
				&& super.mouseY < 26) {
			nx = 5;
		}
		if (nx != 0
				&& super.mouseX >= ((GameImage) (gameGraphics)).menuDefaultWidth - 35 - 165
				&& super.mouseY >= 3
				&& super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 3 - 165
				&& super.mouseY < 26) {
			nx = 6;
		}
		if (nx == 1
				&& (super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 248 || super.mouseY > 240)) {
			nx = 0;
		}
		if (nx >= 2
				&& nx <= 5
				&& (super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 199 || super.mouseY > 240)) {
			nx = 0;
		}
		if (nx == 6
				&& (super.mouseX < ((GameImage) (gameGraphics)).menuDefaultWidth - 199 || super.mouseY > 267)) {
			nx = 0;
		}
	}

	public void wl(boolean arg0) {
		int i1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 248;
		gameGraphics.drawPicutre(i1, 3, az + 1);
		for (int j1 = 0; j1 < 30; j1++) {
			int k1 = i1 + (j1 % 5) * 49;
			int i2 = 36 + (j1 / 5) * 34;
			if (j1 < inventoryCount && wearing[j1] == 1) {
				gameGraphics.nf(k1, i2, 49, 34, 0xff0000, 128);
			} else {
				gameGraphics.nf(k1, i2, 49, 34,
						GameImage.convertRGBtoLong(181, 181, 181), 128);
			}
			if (j1 < inventoryCount) {
				gameGraphics.spriteClip4(k1, i2, 48, 32, nw
						+ Cache.ItemIDS[inventoryItems[j1]],
						Cache.itemPictureMask[inventoryItems[j1]], 0, 0, false);
				if (Cache.itemStackable[inventoryItems[j1]] == 0) {
					gameGraphics.drawString(String.valueOf(inventoryItemsCount[j1]),
							k1 + 1, i2 + 10, 1, 0xffff00);
				}
			}
		}

		for (int l1 = 1; l1 <= 4; l1++) {
			gameGraphics.drawLineY(i1 + l1 * 49, 36, 204, 0);
		}

		for (int j2 = 1; j2 <= 5; j2++) {
			gameGraphics.drawLineX(i1, 36 + j2 * 34, 245, 0);
		}

		if (!arg0) {
			return;
		}
		i1 = super.mouseX - (((GameImage) (gameGraphics)).menuDefaultWidth - 248);
		int k2 = super.mouseY - 36;
		if (i1 >= 0 && k2 >= 0 && i1 < 248 && k2 < 204) {
			int l2 = i1 / 49 + (k2 / 34) * 5;
			if (l2 < inventoryCount) {
				int i3 = inventoryItems[l2];
				if (lcb >= 0) {
					if (Cache.vjb[lcb] == 3) {
						menuText1[menuLength] = mcb + Cache.rjb[lcb] + " on";
						menuText2[menuLength] = "@lre@"
								+ Cache.itemNames[i3][0];
						menuID[menuLength] = 600;
						menuActionType[menuLength] = l2;
						menuActionVariable[menuLength] = lcb;
						menuLength++;
						return;
					}
				} else {
					if (selectedItem >= 0) {
						menuText1[menuLength] = "Use " + tx + " with";
						menuText2[menuLength] = "@lre@"
								+ Cache.itemNames[i3][0];
						menuID[menuLength] = 610;
						menuActionType[menuLength] = l2;
						menuActionVariable[menuLength] = selectedItem;
						menuLength++;
						return;
					}
					if (wearing[l2] == 1) {
						menuText1[menuLength] = "Remove";
						menuText2[menuLength] = "@lre@"
								+ Cache.itemNames[i3][0];
						menuID[menuLength] = 620;
						menuActionType[menuLength] = l2;
						menuLength++;
					} else if (Cache.jgb[i3] != 0) {
						if ((Cache.jgb[i3] & 0x18) != 0) {
							menuText1[menuLength] = "Wield";
						} else {
							menuText1[menuLength] = "Wear";
						}
						menuText2[menuLength] = "@lre@"
								+ Cache.itemNames[i3][0];
						menuID[menuLength] = 630;
						menuActionType[menuLength] = l2;
						menuLength++;
					}
					if (!Cache.itemCommand[i3].equals("_")) {
						menuText1[menuLength] = Cache.itemCommand[i3];
						menuText2[menuLength] = "@lre@"
								+ Cache.itemNames[i3][0];
						menuID[menuLength] = 640;
						menuActionType[menuLength] = l2;
						menuLength++;
					}
					menuText1[menuLength] = "Use";
					menuText2[menuLength] = "@lre@" + Cache.itemNames[i3][0];
					menuID[menuLength] = 650;
					menuActionType[menuLength] = l2;
					menuLength++;
					menuText1[menuLength] = "Drop";
					menuText2[menuLength] = "@lre@" + Cache.itemNames[i3][0];
					menuID[menuLength] = 660;
					menuActionType[menuLength] = l2;
					menuLength++;
					menuText1[menuLength] = "Examine";
					menuText2[menuLength] = "@lre@" + Cache.itemNames[i3][0];
					menuID[menuLength] = 3600;
					menuActionType[menuLength] = i3;
					menuLength++;
				}
			}
		}
	}

	public void vk(boolean arg0) {
		int i1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
		char c1 = '\234';
		char c3 = '\230';
		gameGraphics.drawPicutre(i1 - 49, 3, az + 2);
		i1 += 40;
		gameGraphics.drawBox(i1, 36, c1, c3, 0);
		gameGraphics.setDimensions(i1, 36, i1 + c1, 36 + c3);
		char c5 = '\300';
		int k1 = ((ourPlayer.currentX - 6040) * 3 * c5) / 2048;
		int i3 = ((ourPlayer.currentY - 6040) * 3 * c5) / 2048;
		int k4 = Camera.hm[1024 - cameraRotation * 4 & 0x3ff];
		int i5 = Camera.hm[(1024 - cameraRotation * 4 & 0x3ff) + 1024];
		int k5 = i3 * k4 + k1 * i5 >> 18;
		i3 = i3 * i5 - k1 * k4 >> 18;
		k1 = k5;
		gameGraphics.gf((i1 + c1 / 2) - k1, 36 + c3 / 2 + i3, az - 1,
				cameraRotation + 64 & 0xff, c5);
		for (int i7 = 0; i7 < objectCount; i7++) {
			int l1 = (((objectX[i7] * magicLoc + 64) - ourPlayer.currentX) * 3 * c5) / 2048;
			int j3 = (((objectY[i7] * magicLoc + 64) - ourPlayer.currentY) * 3 * c5) / 2048;
			int l5 = j3 * k4 + l1 * i5 >> 18;
			j3 = j3 * i5 - l1 * k4 >> 18;
			l1 = l5;
			fk(i1 + c1 / 2 + l1, (36 + c3 / 2) - j3, 65535);
		}

		for (int j7 = 0; j7 < groundItemCount; j7++) {
			int i2 = (((groundItemX[j7] * magicLoc + 64) - ourPlayer.currentX) * 3 * c5) / 2048;
			int k3 = (((groundItemY[j7] * magicLoc + 64) - ourPlayer.currentY) * 3 * c5) / 2048;
			int i6 = k3 * k4 + i2 * i5 >> 18;
			k3 = k3 * i5 - i2 * k4 >> 18;
			i2 = i6;
			fk(i1 + c1 / 2 + i2, (36 + c3 / 2) - k3, 0xff0000);
		}

		for (int k7 = 0; k7 < npcCount; k7++) {
			Mob l7 = npcArray[k7];
			int j2 = ((l7.currentX - ourPlayer.currentX) * 3 * c5) / 2048;
			int l3 = ((l7.currentY - ourPlayer.currentY) * 3 * c5) / 2048;
			int j6 = l3 * k4 + j2 * i5 >> 18;
			l3 = l3 * i5 - j2 * k4 >> 18;
			j2 = j6;
			fk(i1 + c1 / 2 + j2, (36 + c3 / 2) - l3, 0xffff00);
		}

		for (int i8 = 0; i8 < playerCount; i8++) {
			Mob l8 = playerArray[i8];
			int k2 = ((l8.currentX - ourPlayer.currentX) * 3 * c5) / 2048;
			int i4 = ((l8.currentY - ourPlayer.currentY) * 3 * c5) / 2048;
			int k6 = i4 * k4 + k2 * i5 >> 18;
			i4 = i4 * i5 - k2 * k4 >> 18;
			k2 = k6;
			fk(i1 + c1 / 2 + k2, (36 + c3 / 2) - i4, 0xffffff);
		}

		gameGraphics.rf(i1 + c1 / 2, 36 + c3 / 2, 2, 0xffffff, 255);
		gameGraphics.gf(i1 + 19, 55, az + 24, cameraRotation + 128 & 0xff, 128);
		gameGraphics.setDimensions(0, 0, windowWidth, windowHeight + 12);
		if (!arg0) {
			return;
		}
		i1 = super.mouseX - (((GameImage) (gameGraphics)).menuDefaultWidth - 199);
		int j8 = super.mouseY - 36;
		if (i1 >= 40 && j8 >= 0 && i1 < 196 && j8 < 152) {
			char c2 = '\234';
			char c4 = '\230';
			char c6 = '\300';
			int j1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
			j1 += 40;
			int l2 = ((super.mouseX - (j1 + c2 / 2)) * 16384) / (3 * c6);
			int j4 = ((super.mouseY - (36 + c4 / 2)) * 16384) / (3 * c6);
			int l4 = Camera.hm[1024 - cameraRotation * 4 & 0x3ff];
			int j5 = Camera.hm[(1024 - cameraRotation * 4 & 0x3ff) + 1024];
			int l6 = j4 * l4 + l2 * j5 >> 15;
			j4 = j4 * j5 - l2 * l4 >> 15;
			l2 = l6;
			l2 += ourPlayer.currentX;
			j4 = ourPlayer.currentY - j4;
			if (mx == 1) {
				ul(sectionX, sectionY, l2 / 128, j4 / 128, false);
			}
			mx = 0;
		}
	}

	public void drawSkillsMenu(boolean arg0) {
		int i1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
		gameGraphics.drawPicutre(i1 - 49, 3, az + 3);
		char c1 = '\304';
		char c2 = '\266';
		gameGraphics.nf(i1, 36, c1, c2, GameImage.convertRGBtoLong(181, 181, 181), 160);
		int j1 = 48;
		gameGraphics.drawString("Skills", i1 + 5, j1, 3, 0xffff00);
		j1 += 13;
		for (int s = 0; s < 8; s++) {
			gameGraphics.drawString(skillArray[s] + ":@yel@" + playerStatCurrent[s] + "/" + playerStatBase[s], i1 + 5, j1, 1, 0xffffff);
			gameGraphics.drawString(skillArray[s + 8] + ":@yel@" + playerStatCurrent[s + 8] + "/" + playerStatBase[s + 8], (i1 + c1 / 2) - 8, j1 - 13, 1, 0xffffff);
			j1 += 13;
		}

		gameGraphics.drawString("Quest Points:@yel@" + questPoints, (i1 + c1 / 2) - 8, j1 - 13, 1, 0xffffff);
		j1 += 8;
		gameGraphics.drawString("Equipment Status", i1 + 5, j1, 3, 0xffff00);
		j1 += 12;
		for (int l1 = 0; l1 < 3; l1++) {
			gameGraphics.drawString(ty[l1] + ":@yel@" + equipmentStatus[l1], i1 + 5, j1, 1, 0xffffff);
			if (l1 < 2) {
				gameGraphics.drawString(ty[l1 + 3] + ":@yel@" + equipmentStatus[l1 + 3], i1 + c1 / 2 + 25, j1, 1, 0xffffff);
			}
			j1 += 13;
		}

	}

	public void drawMagicPrayerMenu(boolean arg0) {
		int i1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
		int j1 = 36;
		gameGraphics.drawPicutre(i1 - 49, 3, az + 4);
		char c1 = '\304';
		char c2 = '\266';
		int l1;
		int k1 = l1 = GameImage.convertRGBtoLong(160, 160, 160);
		if (gcb == 0) {
			k1 = GameImage.convertRGBtoLong(220, 220, 220);
		} else {
			l1 = GameImage.convertRGBtoLong(220, 220, 220);
		}
		gameGraphics.nf(i1, j1, c1 / 2, 24, k1, 128);
		gameGraphics.nf(i1 + c1 / 2, j1, c1 / 2, 24, l1, 128);
		gameGraphics.nf(i1, j1 + 24, c1, 90,
				GameImage.convertRGBtoLong(220, 220, 220), 128);
		gameGraphics.nf(i1, j1 + 24 + 90, c1, c2 - 90 - 24,
				GameImage.convertRGBtoLong(160, 160, 160), 128);
		gameGraphics.drawLineX(i1, j1 + 24, c1, 0);
		gameGraphics.drawLineY(i1 + c1 / 2, j1, 24, 0);
		gameGraphics.drawLineX(i1, j1 + 113, c1, 0);
		gameGraphics.drawText("Magic", i1 + c1 / 4, j1 + 16, 4, 0);
		gameGraphics.drawText("Prayers", i1 + c1 / 4 + c1 / 2, j1 + 16, 4, 0);
		if (gcb == 0) {
			ecb.kc(fcb);
			int i2 = 0;
			for (int k2 = 0; k2 < Cache.qjb; k2++) {
				String s = "@yel@";
				for (int k3 = 0; k3 < Cache.ujb[k2]; k3++) {
					int j4 = Cache.xjb[k2][k3];
					if (mk(j4, Cache.yjb[k2][k3])) {
						continue;
					}
					s = "@whi@";
					break;
				}

				int k4 = playerStatCurrent[6];
				if (Cache.tjb[k2] > k4) {
					s = "@bla@";
				}
				ecb.ad(fcb, i2++, s + "Level " + Cache.tjb[k2] + ": " + Cache.rjb[k2]);
			}

			ecb.drawMenu();
			int i3 = ecb.hc(fcb);
			if (i3 != -1) {
				gameGraphics.drawString(
						"Level " + Cache.tjb[i3] + ": " + Cache.rjb[i3],
						i1 + 2, j1 + 124, 1, 0);
				gameGraphics.drawString(Cache.sjb[i3], i1 + 2, j1 + 136, 0, 0);
				for (int l3 = 0; l3 < Cache.ujb[i3]; l3++) {
					int l4 = Cache.xjb[i3][l3];
					gameGraphics.drawPicutre(i1 + 2 + l3 * 44, j1 + 150, nw
							+ Cache.ItemIDS[l4]);
					int i5 = dk(l4);
					int j5 = Cache.yjb[i3][l3];
					String s1 = "@red@";
					if (mk(l4, j5)) {
						s1 = "@gre@";
					}
					gameGraphics.drawString(s1 + i5 + "/" + j5, i1 + 2 + l3 * 44,
							j1 + 150, 1, 0xffffff);
				}

			} else {
				gameGraphics.drawString("Point at a spell for a description", i1 + 2, j1 + 124, 1, 0);
			}
		}
		if (!arg0) {
			return;
		}
		i1 = super.mouseX - (((GameImage) (gameGraphics)).menuDefaultWidth - 199);
		j1 = super.mouseY - 36;
		if (i1 >= 0 && j1 >= 0 && i1 < 196 && j1 < 182) {
			ecb.md(i1 + (((GameImage) (gameGraphics)).menuDefaultWidth - 199),
					j1 + 36, super.pq, super.mouseDownButton);
			if (j1 <= 24 && mx == 1) {
				if (i1 < 98 && gcb == 1) {
					gcb = 0;
					ecb.xc(fcb);
				} else if (i1 > 98 && gcb == 0) {
					gcb = 1;
					ecb.xc(fcb);
				}
			}
			if (mx == 1 && gcb == 0) {
				int j2 = ecb.hc(fcb);
				if (j2 != -1) {
					int l2 = playerStatCurrent[6];
					if (Cache.tjb[j2] > l2) {
						displayMessage(
								"Your magic ability is not high enough for this spell",
								3);
					} else {
						int j3;
						for (j3 = 0; j3 < Cache.ujb[j2]; j3++) {
							int i4 = Cache.xjb[j2][j3];
							if (mk(i4, Cache.yjb[j2][j3])) {
								continue;
							}
							displayMessage("You don't have all the reagents you need for this spell", 3);
							j3 = -1;
							break;
						}

						if (j3 == Cache.ujb[j2]) {
							lcb = j2;
							selectedItem = -1;
							mcb = "Cast ";
						}
					}
				}
			}
			mx = 0;
		}
	}

	public void tl(boolean arg0) {
		int i1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
		int j1 = 36;
		gameGraphics.drawPicutre(i1 - 49, 3, az + 5);
		char c1 = '\304';
		char c2 = '\266';
		int l1;
		int k1 = l1 = GameImage.convertRGBtoLong(160, 160, 160);
		if (jcb == 0) {
			k1 = GameImage.convertRGBtoLong(220, 220, 220);
		} else {
			l1 = GameImage.convertRGBtoLong(220, 220, 220);
		}
		gameGraphics.nf(i1, j1, c1 / 2, 24, k1, 128);
		gameGraphics.nf(i1 + c1 / 2, j1, c1 / 2, 24, l1, 128);
		gameGraphics.nf(i1, j1 + 24, c1, c2 - 24,
				GameImage.convertRGBtoLong(220, 220, 220), 128);
		gameGraphics.drawLineX(i1, j1 + 24, c1, 0);
		gameGraphics.drawLineY(i1 + c1 / 2, j1, 24, 0);
		gameGraphics.drawLineX(i1, (j1 + c2) - 16, c1, 0);
		gameGraphics.drawText("Friends", i1 + c1 / 4, j1 + 16, 4, 0);
		gameGraphics.drawText("Ignore", i1 + c1 / 4 + c1 / 2, j1 + 16, 4, 0);
		hcb.kc(icb);
		if (jcb == 0) {
			for (int i2 = 0; i2 < super.friendsCount; i2++) {
				String s;
				if (super.friendListOnlineStatus[i2] == 2) {
					s = "@gre@";
				} else if (super.friendListOnlineStatus[i2] == 1) {
					s = "@yel@";
				} else {
					s = "@red@";
				}
				hcb.ad(icb, i2, s + DataOperations.longToString(super.friendListLongs[i2]) + "~439~@whi@Remove         WWWWWWWWWW");
			}

		}
		if (jcb == 1) {
			for (int j2 = 0; j2 < super.ignoreListCount; j2++) {
				hcb.ad(icb, j2, "@yel@" + DataOperations.longToString(super.ignoreListLongs[j2]) + "~439~@whi@Remove         WWWWWWWWWW");
			}

		}
		hcb.drawMenu();
		if (jcb == 0) {
			int k2 = hcb.hc(icb);
			if (k2 >= 0 && super.mouseX < 489) {
				if (super.mouseX > 429) {
					gameGraphics
							.drawText(
									"Click to remove "
											+ DataOperations
													.longToString(super.friendListLongs[k2]),
									i1 + c1 / 2, j1 + 35, 1, 0xffffff);
				} else if (super.friendListOnlineStatus[k2] == 2) {
					gameGraphics
							.drawText(
									"Click to message "
											+ DataOperations
													.longToString(super.friendListLongs[k2]),
									i1 + c1 / 2, j1 + 35, 1, 0xffffff);
				} else if (super.friendListOnlineStatus[k2] == 1) {
					gameGraphics.drawText(
							DataOperations
									.longToString(super.friendListLongs[k2])
									+ " is on a different server", i1 + c1 / 2,
							j1 + 35, 1, 0xffffff);
				} else {
					gameGraphics.drawText(
							DataOperations
									.longToString(super.friendListLongs[k2])
									+ " is offline", i1 + c1 / 2, j1 + 35, 1,
							0xffffff);
				}
			} else {
				gameGraphics.drawText("Click a name to send a message", i1 + c1
						/ 2, j1 + 35, 1, 0xffffff);
			}
			int k3;
			if (super.mouseX > i1 && super.mouseX < i1 + c1
					&& super.mouseY > (j1 + c2) - 16 && super.mouseY < j1 + c2) {
				k3 = 0xffff00;
			} else {
				k3 = 0xffffff;
			}
			gameGraphics.drawText("Click here to add a friend", i1 + c1 / 2,
					(j1 + c2) - 3, 1, k3);
		}
		if (jcb == 1) {
			int l2 = hcb.hc(icb);
			if (l2 >= 0 && super.mouseX < 489 && super.mouseX > 429) {
				if (super.mouseX > 429) {
					gameGraphics
							.drawText(
									"Click to remove "
											+ DataOperations
													.longToString(super.ignoreListLongs[l2]),
									i1 + c1 / 2, j1 + 35, 1, 0xffffff);
				}
			} else {
				gameGraphics.drawText("Blocking messages from:", i1 + c1 / 2,
						j1 + 35, 1, 0xffffff);
			}
			int l3;
			if (super.mouseX > i1 && super.mouseX < i1 + c1
					&& super.mouseY > (j1 + c2) - 16 && super.mouseY < j1 + c2) {
				l3 = 0xffff00;
			} else {
				l3 = 0xffffff;
			}
			gameGraphics.drawText("Click here to add a name", i1 + c1 / 2,
					(j1 + c2) - 3, 1, l3);
		}
		if (!arg0) {
			return;
		}
		i1 = super.mouseX - (((GameImage) (gameGraphics)).menuDefaultWidth - 199);
		j1 = super.mouseY - 36;
		if (i1 >= 0 && j1 >= 0 && i1 < 196 && j1 < 182) {
			hcb.md(i1 + (((GameImage) (gameGraphics)).menuDefaultWidth - 199),
					j1 + 36, super.pq, super.mouseDownButton);
			if (j1 <= 24 && mx == 1) {
				if (i1 < 98 && jcb == 1) {
					jcb = 0;
					hcb.xc(icb);
				} else if (i1 > 98 && jcb == 0) {
					jcb = 1;
					hcb.xc(icb);
				}
			}
			if (mx == 1 && jcb == 0) {
				int i3 = hcb.hc(icb);
				if (i3 >= 0 && super.mouseX < 489) {
					if (super.mouseX > 429) {
						removeFriend(super.friendListLongs[i3]);
					} else if (super.friendListOnlineStatus[i3] != 0) {
						ht = 2;
						kcb = super.friendListLongs[i3];
						super.inputMessage = "";
						super.enteredMessage = "";
					}
				}
			}
			if (mx == 1 && jcb == 1) {
				int j3 = hcb.hc(icb);
				if (j3 >= 0 && super.mouseX < 489 && super.mouseX > 429) {
					cb(super.ignoreListLongs[j3]);
				}
			}
			if (j1 > 166 && mx == 1 && jcb == 0) {
				ht = 1;
				super.inputText = "";
				super.enteredText = "";
			}
			if (j1 > 166 && mx == 1 && jcb == 1) {
				ht = 3;
				super.inputText = "";
				super.enteredText = "";
			}
			mx = 0;
		}
	}

	public void kl(boolean arg0) {
		int i1 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
		int j1 = 36;
		gameGraphics.drawPicutre(i1 - 49, 3, az + 6);
		char c1 = '\304';
		gameGraphics.nf(i1, 36, c1, 90,
				GameImage.convertRGBtoLong(181, 181, 181), 160);
		gameGraphics.nf(i1, 126, c1, 105,
				GameImage.convertRGBtoLong(201, 2011, 201), 160);
		gameGraphics.nf(i1, 231, c1, 30,
				GameImage.convertRGBtoLong(181, 181, 181), 160);
		int k1 = i1 + 3;
		int i2 = j1 + 15;
		gameGraphics.drawString("Game options - click to toggle", k1, i2, 1, 0);
		i2 += 15;
		if (cameraAngleMode) {
			gameGraphics.drawString("Camera angle mode - @gre@Auto", k1, i2, 1,
					0xffffff);
		} else {
			gameGraphics.drawString("Camera angle mode - @red@Manual", k1, i2, 1,
					0xffffff);
		}
		i2 += 15;
		if (mouseButtons) {
			gameGraphics.drawString("Mouse buttons - @red@One", k1, i2, 1, 0xffffff);
		} else {
			gameGraphics.drawString("Mouse buttons - @gre@Two", k1, i2, 1, 0xffffff);
		}
		i2 += 15;
		if (playerKiller) {
			gameGraphics.drawString("Player type: @red@Player-Killer", k1, i2, 1,
					0xffffff);
		} else {
			gameGraphics.drawString("Player type: @gre@Non Player-Killer", k1, i2, 1,
					0xffffff);
		}
		i2 += 15;
		int k2 = 0xffffff;
		if (super.mouseX > k1 && super.mouseX < k1 + c1 && super.mouseY > i2 - 12
				&& super.mouseY < i2 + 4) {
			k2 = 0xffff00;
		}
		gameGraphics.drawString("Change password", k1, i2, 1, k2);
		i2 += 15;
		i2 += 15;
		gameGraphics.drawString("Privacy settings. Will be applied to", i1 + 3, i2, 1,
				0);
		i2 += 15;
		gameGraphics
				.drawString("all people not on your friends list", i1 + 3, i2, 1, 0);
		i2 += 15;
		if (super.hideOnlineStatus == 0) {
			gameGraphics.drawString("Hide online-status: @red@<off>", i1 + 3, i2, 1,
					0xffffff);
		} else {
			gameGraphics.drawString("Hide online-status: @gre@<on>", i1 + 3, i2, 1,
					0xffffff);
		}
		i2 += 15;
		if (super.blockChatMessages == 0) {
			gameGraphics.drawString("Block chat messages: @red@<off>", i1 + 3, i2, 1,
					0xffffff);
		} else {
			gameGraphics.drawString("Block chat messages: @gre@<on>", i1 + 3, i2, 1,
					0xffffff);
		}
		i2 += 15;
		if (super.blockPrivateMessages == 0) {
			gameGraphics.drawString("Block private messages: @red@<off>", i1 + 3, i2,
					1, 0xffffff);
		} else {
			gameGraphics.drawString("Block private messages: @gre@<on>", i1 + 3, i2, 1,
					0xffffff);
		}
		i2 += 15;
		if (super.blockTradeRequests == 0) {
			gameGraphics.drawString("Block trade requests: @red@<off>", i1 + 3, i2, 1,
					0xffffff);
		} else {
			gameGraphics.drawString("Block trade requests: @gre@<on>", i1 + 3, i2, 1,
					0xffffff);
		}
		i2 += 15;
		i2 += 15;
		k2 = 0xffffff;
		if (super.mouseX > k1 && super.mouseX < k1 + c1 && super.mouseY > i2 - 12
				&& super.mouseY < i2 + 4) {
			k2 = 0xffff00;
		}
		gameGraphics.drawString("Click here to logout", i1 + 3, i2, 1, k2);
		if (!arg0) {
			return;
		}
		i1 = super.mouseX - (((GameImage) (gameGraphics)).menuDefaultWidth - 199);
		j1 = super.mouseY - 36;
		if (i1 >= 0 && j1 >= 0 && i1 < 196 && j1 < 231) {
			int l2 = ((GameImage) (gameGraphics)).menuDefaultWidth - 199;
			byte byte0 = 36;
			char c2 = '\304';
			int l1 = l2 + 3;
			int j2 = byte0 + 30;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				cameraAngleMode = !cameraAngleMode;
				super.streamClass.createPacket(213);
				super.streamClass.addByte(0);
				super.streamClass.addByte(cameraAngleMode ? 1 : 0);
				super.streamClass.formatPacket();
			}
			j2 += 15;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				mouseButtons = !mouseButtons;
				super.streamClass.createPacket(213);
				super.streamClass.addByte(2);
				super.streamClass.addByte(mouseButtons ? 1 : 0);
				super.streamClass.formatPacket();
			}
			j2 += 15;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1 && pvpChangeAvaible > 0) {
				ft = 1;
			}
			j2 += 15;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				gt = 1;
				super.inputText = "";
				super.enteredText = "";
			}
			boolean flag = false;
			j2 += 60;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				super.hideOnlineStatus = 1 - super.hideOnlineStatus;
				flag = true;
			}
			j2 += 15;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				super.blockChatMessages = 1 - super.blockChatMessages;
				flag = true;
			}
			j2 += 15;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				super.blockPrivateMessages = 1 - super.blockPrivateMessages;
				flag = true;
			}
			j2 += 15;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				super.blockTradeRequests = 1 - super.blockTradeRequests;
				flag = true;
			}
			if (flag) {
				nb(super.hideOnlineStatus, super.blockChatMessages,
						super.blockPrivateMessages, super.blockTradeRequests, 0);
			}
			j2 += 30;
			if (super.mouseX > l1 && super.mouseX < l1 + c2 && super.mouseY > j2 - 12
					&& super.mouseY < j2 + 4 && mx == 1) {
				if (lastDeath > 450) {
					displayMessage("@cya@You can't logout during combat!", 3);
				} else if (lastDeath > 0) {
					displayMessage(
							"@cya@You can't logout for 10 seconds after combat",
							3);
				} else {
					sendLogoutPacket();
					return;
				}
			}
			mx = 0;
		}
	}

	public void tk() {
		int i1 = -1;
		for (int j1 = 0; j1 < objectCount; j1++) {
			ax[j1] = false;
		}

		for (int k1 = 0; k1 < doorCount; k1++) {
			ix[k1] = false;
		}

		int l1 = gameCamera.mi();
		Model ah[] = gameCamera.ih();
		int ai[] = gameCamera.hi();
		for (int i2 = 0; i2 < l1; i2++) {
			int j2 = ai[i2];
			Model h1 = ah[i2];
			if (h1.qh[j2] <= 65535 || h1.qh[j2] >= 0x30d40
					&& h1.qh[j2] <= 0x493e0) {
				if (h1 == gameCamera.vn) {
					int curPlayer = h1.qh[j2] % 10000;
					int k3 = h1.qh[j2] / 10000;
					if (k3 == 1) {
						String s = "";
						int j4 = -1;
						int l4 = playerArray[curPlayer].pvpSetting;
						if (l4 == 1) {
							j4 = 0;
							if (ourPlayer.level > 0
									&& playerArray[curPlayer].level > 0) {
								j4 = ourPlayer.level
										- playerArray[curPlayer].level;
							}
							if (j4 < 0) {
								s = "@or1@";
							}
							if (j4 < -3) {
								s = "@or2@";
							}
							if (j4 < -6) {
								s = "@or3@";
							}
							if (j4 < -9) {
								s = "@red@";
							}
							if (j4 > 0) {
								s = "@gr1@";
							}
							if (j4 > 3) {
								s = "@gr2@";
							}
							if (j4 > 6) {
								s = "@gr3@";
							}
							if (j4 > 9) {
								s = "@gre@";
							}
							s = " " + s + "(level-"
									+ playerArray[curPlayer].level + ")";
						}
						if (lcb >= 0) {
							if (Cache.vjb[lcb] == 1 || Cache.vjb[lcb] == 2
									&& l4 == 1 && ourPlayer.pvpSetting == 1) {
								menuText1[menuLength] = mcb + Cache.rjb[lcb]
										+ " on";
								menuText2[menuLength] = "@whi@"
										+ playerArray[curPlayer].name;
								menuID[menuLength] = 800;
								menuActionX[menuLength] = playerArray[curPlayer].currentX;
								menuActionY[menuLength] = playerArray[curPlayer].currentY;
								menuActionType[menuLength] = playerArray[curPlayer].serverIndex;
								menuActionVariable[menuLength] = lcb;
								menuLength++;
							}
						} else if (selectedItem >= 0) {
							menuText1[menuLength] = "Use " + tx + " with";
							menuText2[menuLength] = "@whi@"
									+ playerArray[curPlayer].name;
							menuID[menuLength] = 810;
							menuActionX[menuLength] = playerArray[curPlayer].currentX;
							menuActionY[menuLength] = playerArray[curPlayer].currentY;
							menuActionType[menuLength] = playerArray[curPlayer].serverIndex;
							menuActionVariable[menuLength] = selectedItem;
							menuLength++;
						} else {
							if (l4 == 1 && ourPlayer.pvpSetting == 1) {
								menuText1[menuLength] = "Attack";
								menuText2[menuLength] = "@whi@"
										+ playerArray[curPlayer].name + s;
								if (j4 >= 0 && j4 < 5) {
									menuID[menuLength] = 805;
								} else {
									menuID[menuLength] = 2805;
								}
								menuActionX[menuLength] = playerArray[curPlayer].currentX;
								menuActionY[menuLength] = playerArray[curPlayer].currentY;
								menuActionType[menuLength] = playerArray[curPlayer].serverIndex;
								menuLength++;
							}
							menuText1[menuLength] = "Trade with";
							menuText2[menuLength] = "@whi@"
									+ playerArray[curPlayer].name;
							menuID[menuLength] = 2810;
							menuActionType[menuLength] = playerArray[curPlayer].serverIndex;
							menuLength++;
							menuText1[menuLength] = "Follow";
							menuText2[menuLength] = "@whi@"
									+ playerArray[curPlayer].name;
							menuID[menuLength] = 2820;
							menuActionType[menuLength] = playerArray[curPlayer].serverIndex;
							menuLength++;
						}
					} else if (k3 == 2) {
						if (lcb >= 0) {
							if (Cache.vjb[lcb] == 3) {
								menuText1[menuLength] = mcb + Cache.rjb[lcb]
										+ " on";
								menuText2[menuLength] = "@lre@"
										+ Cache.itemNames[groundItemType[curPlayer]][0];
								menuID[menuLength] = 200;
								menuActionX[menuLength] = groundItemX[curPlayer];
								menuActionY[menuLength] = groundItemY[curPlayer];
								menuActionType[menuLength] = groundItemType[curPlayer];
								menuActionVariable[menuLength] = lcb;
								menuLength++;
							}
						} else if (selectedItem >= 0) {
							menuText1[menuLength] = "Use " + tx + " with";
							menuText2[menuLength] = "@lre@"
									+ Cache.itemNames[groundItemType[curPlayer]][0];
							menuID[menuLength] = 210;
							menuActionX[menuLength] = groundItemX[curPlayer];
							menuActionY[menuLength] = groundItemY[curPlayer];
							menuActionType[menuLength] = groundItemType[curPlayer];
							menuActionVariable[menuLength] = selectedItem;
							menuLength++;
						} else {
							menuText1[menuLength] = "Take";
							menuText2[menuLength] = "@lre@"
									+ Cache.itemNames[groundItemType[curPlayer]][0];
							menuID[menuLength] = 220;
							menuActionX[menuLength] = groundItemX[curPlayer];
							menuActionY[menuLength] = groundItemY[curPlayer];
							menuActionType[menuLength] = groundItemType[curPlayer];
							menuLength++;
							menuText1[menuLength] = "Examine";
							menuText2[menuLength] = "@lre@"
									+ Cache.itemNames[groundItemType[curPlayer]][0]
									+ (ourPlayer.admin >= 1 ? " @or1@("
											+ groundItemType[curPlayer] + ")"
											: "");
							menuID[menuLength] = 3200;
							menuActionType[menuLength] = groundItemType[curPlayer];
							menuLength++;
						}
					} else if (k3 == 3) {
						String s1 = "";
						int k4 = -1;
						int i5 = npcArray[curPlayer].type;
						if (Cache.vgb[i5] > 0) {
							int j5 = (Cache.npcAttack[i5] + Cache.npcHits[i5]
									+ Cache.npcStrength[i5] + Cache.npcDefense[i5]) / 4;
							int k5 = (playerStatBase[0] + playerStatBase[1]
									+ playerStatBase[2] + playerStatBase[3] + 27) / 4;
							k4 = k5 - j5;
							s1 = "@yel@";
							if (k4 < 0) {
								s1 = "@or1@";
							}
							if (k4 < -3) {
								s1 = "@or2@";
							}
							if (k4 < -6) {
								s1 = "@or3@";
							}
							if (k4 < -9) {
								s1 = "@red@";
							}
							if (k4 > 0) {
								s1 = "@gr1@";
							}
							if (k4 > 3) {
								s1 = "@gr2@";
							}
							if (k4 > 6) {
								s1 = "@gr3@";
							}
							if (k4 > 9) {
								s1 = "@gre@";
							}
							s1 = " " + s1 + "(level-" + j5 + ")";
						}
						if (lcb >= 0) {
							if (Cache.vjb[lcb] == 2) {
								menuText1[menuLength] = mcb + Cache.rjb[lcb]
										+ " on";
								menuText2[menuLength] = "@yel@"
										+ Cache.npcExamine[npcArray[curPlayer].type][0];
								menuID[menuLength] = 700;
								menuActionX[menuLength] = npcArray[curPlayer].currentX;
								menuActionY[menuLength] = npcArray[curPlayer].currentY;
								menuActionType[menuLength] = npcArray[curPlayer].serverIndex;
								menuActionVariable[menuLength] = lcb;
								menuLength++;
							}
						} else if (selectedItem >= 0) {
							menuText1[menuLength] = "Use " + tx + " with";
							menuText2[menuLength] = "@yel@"
									+ Cache.npcExamine[npcArray[curPlayer].type][0];
							menuID[menuLength] = 710;
							menuActionX[menuLength] = npcArray[curPlayer].currentX;
							menuActionY[menuLength] = npcArray[curPlayer].currentY;
							menuActionType[menuLength] = npcArray[curPlayer].serverIndex;
							menuActionVariable[menuLength] = selectedItem;
							menuLength++;
						} else {
							if (Cache.vgb[i5] > 0) {
								menuText1[menuLength] = "Attack";
								menuText2[menuLength] = "@yel@"
										+ Cache.npcExamine[npcArray[curPlayer].type][0]
										+ s1;
								if (k4 >= 0) {
									menuID[menuLength] = 715;
								} else {
									menuID[menuLength] = 2715;
								}
								menuActionX[menuLength] = npcArray[curPlayer].currentX;
								menuActionY[menuLength] = npcArray[curPlayer].currentY;
								menuActionType[menuLength] = npcArray[curPlayer].serverIndex;
								menuLength++;
							}
							menuText1[menuLength] = "Talk-to";
							menuText2[menuLength] = "@yel@"
									+ Cache.npcExamine[npcArray[curPlayer].type][0];
							menuID[menuLength] = 720;
							menuActionX[menuLength] = npcArray[curPlayer].currentX;
							menuActionY[menuLength] = npcArray[curPlayer].currentY;
							menuActionType[menuLength] = npcArray[curPlayer].serverIndex;
							menuLength++;
							menuText1[menuLength] = "Examine";
							menuText2[menuLength] = "@yel@"
									+ Cache.npcExamine[npcArray[curPlayer].type][0]
									+ (ourPlayer.admin >= 1 ? " @or1@("
											+ npcArray[curPlayer].type + ")"
											: "");
							menuID[menuLength] = 3700;
							menuActionType[menuLength] = npcArray[curPlayer].type;
							menuLength++;
						}
					}
				} else if (h1 != null && h1.ph >= 10000) {
					int i3 = h1.ph - 10000;
					int l3 = doorType[i3];
					if (!ix[i3]) {
						if (lcb >= 0) {
							if (Cache.vjb[lcb] == 4) {
								menuText1[menuLength] = mcb + Cache.rjb[lcb]
										+ " on";
								menuText2[menuLength] = "@cya@"
										+ Cache.mib[l3][0];
								menuID[menuLength] = 300;
								menuActionX[menuLength] = doorX[i3];
								menuActionY[menuLength] = doorY[i3];
								menuActionType[menuLength] = doorDirection[i3];
								menuActionVariable[menuLength] = lcb;
								menuLength++;
							}
						} else if (selectedItem >= 0) {
							menuText1[menuLength] = "Use " + tx + " with";
							menuText2[menuLength] = "@cya@" + Cache.mib[l3][0];
							menuID[menuLength] = 310;
							menuActionX[menuLength] = doorX[i3];
							menuActionY[menuLength] = doorY[i3];
							menuActionType[menuLength] = doorDirection[i3];
							menuActionVariable[menuLength] = selectedItem;
							menuLength++;
						} else {
							if (!Cache.oib[l3].equalsIgnoreCase("WalkTo")) {
								menuText1[menuLength] = Cache.oib[l3];
								menuText2[menuLength] = "@cya@"
										+ Cache.mib[l3][0];
								menuID[menuLength] = 320;
								menuActionX[menuLength] = doorX[i3];
								menuActionY[menuLength] = doorY[i3];
								menuActionType[menuLength] = doorDirection[i3];
								menuLength++;
							}
							if (!Cache.pib[l3].equalsIgnoreCase("Examine")) {
								menuText1[menuLength] = Cache.pib[l3];
								menuText2[menuLength] = "@cya@"
										+ Cache.mib[l3][0];
								menuID[menuLength] = 2300;
								menuActionX[menuLength] = doorX[i3];
								menuActionY[menuLength] = doorY[i3];
								menuActionType[menuLength] = doorDirection[i3];
								menuLength++;
							}
							menuText1[menuLength] = "Examine";
							menuText2[menuLength] = "@cya@" + Cache.mib[l3][0];
							menuID[menuLength] = 3300;
							menuActionType[menuLength] = l3;
							menuLength++;
						}
						ix[i3] = true;
					}
				} else if (h1 != null && h1.ph >= 0) {
					int j3 = h1.ph;
					int i4 = objectType[j3];
					if (!ax[j3]) {
						if (lcb >= 0) {
							if (Cache.vjb[lcb] == 5) {
								menuText1[menuLength] = mcb + Cache.rjb[lcb]
										+ " on";
								menuText2[menuLength] = "@cya@"
										+ Cache.objectName[i4][0];
								menuID[menuLength] = 400;
								menuActionX[menuLength] = objectX[j3];
								menuActionY[menuLength] = objectY[j3];
								menuActionType[menuLength] = objectID[j3];
								menuActionVariable[menuLength] = objectType[j3];
								sv[menuLength] = lcb;
								menuLength++;
							}
						} else if (selectedItem >= 0) {
							menuText1[menuLength] = "Use " + tx + " with";
							menuText2[menuLength] = "@cya@" + Cache.objectName[i4][0];
							menuID[menuLength] = 410;
							menuActionX[menuLength] = objectX[j3];
							menuActionY[menuLength] = objectY[j3];
							menuActionType[menuLength] = objectID[j3];
							menuActionVariable[menuLength] = objectType[j3];
							sv[menuLength] = selectedItem;
							menuLength++;
						} else {
							if (!Cache.command1[i4].equalsIgnoreCase("WalkTo")) {
								menuText1[menuLength] = Cache.command1[i4];
								menuText2[menuLength] = "@cya@"
										+ Cache.objectName[i4][0];
								menuID[menuLength] = 420;
								menuActionX[menuLength] = objectX[j3];
								menuActionY[menuLength] = objectY[j3];
								menuActionType[menuLength] = objectID[j3];
								menuActionVariable[menuLength] = objectType[j3];
								menuLength++;
							}
							if (!Cache.command2[i4].equalsIgnoreCase("Examine")) {
								menuText1[menuLength] = Cache.command2[i4];
								menuText2[menuLength] = "@cya@"
										+ Cache.objectName[i4][0];
								menuID[menuLength] = 2400;
								menuActionX[menuLength] = objectX[j3];
								menuActionY[menuLength] = objectY[j3];
								menuActionType[menuLength] = objectID[j3];
								menuActionVariable[menuLength] = objectType[j3];
								menuLength++;
							}
							menuText1[menuLength] = "Examine";
							menuText2[menuLength] = "@cya@" + Cache.objectName[i4][0];
							menuID[menuLength] = 3400;
							menuActionType[menuLength] = i4;
							menuLength++;
						}
						ax[j3] = true;
					}
				} else {
					if (j2 >= 0) {
						j2 = h1.qh[j2] - 0x30d40;
					}
					if (j2 >= 0) {
						i1 = j2;
					}
				}
			}
		}

		if (lcb >= 0 && Cache.vjb[lcb] <= 1) {
			menuText1[menuLength] = mcb + "on self";
			menuText2[menuLength] = "";
			menuID[menuLength] = 1000;
			menuActionType[menuLength] = lcb;
			menuLength++;
		}
		if (i1 != -1) {
			int k2 = i1;
			if (lcb >= 0) {
				if (Cache.vjb[lcb] == 6) {
					menuText1[menuLength] = mcb + "on ground";
					menuText2[menuLength] = "";
					menuID[menuLength] = 900;
					menuActionX[menuLength] = terrain.reb[k2];
					menuActionY[menuLength] = terrain.seb[k2];
					menuActionType[menuLength] = lcb;
					menuLength++;
					return;
				}
			} else if (selectedItem < 0) {
				menuText1[menuLength] = "Walk here";
				menuText2[menuLength] = "";
				menuID[menuLength] = 920;
				menuActionX[menuLength] = terrain.reb[k2];
				menuActionY[menuLength] = terrain.seb[k2];
				menuLength++;
			}
		}
	}

	public void am() {
		if (mx != 0) {
			for (int i1 = 0; i1 < menuLength; i1++) {
				int k1 = ev + 2;
				int i2 = fv + 27 + i1 * 15;
				if (super.mouseX <= k1 - 2 || super.mouseY <= i2 - 12
						|| super.mouseY >= i2 + 4 || super.mouseX >= (k1 - 3) + gv) {
					continue;
				}
				jl(tv[i1]);
				break;
			}

			mx = 0;
			dv = false;
			return;
		}
		if (super.mouseX < ev - 10 || super.mouseY < fv - 10 || super.mouseX > ev + gv + 10
				|| super.mouseY > fv + hv + 10) {
			dv = false;
			return;
		}
		gameGraphics.nf(ev, fv, gv, hv, 0xd0d0d0, 160);
		gameGraphics.drawString("Choose option", ev + 2, fv + 12, 1, 65535);
		for (int j1 = 0; j1 < menuLength; j1++) {
			int l1 = ev + 2;
			int j2 = fv + 27 + j1 * 15;
			int k2 = 0xffffff;
			if (super.mouseX > l1 - 2 && super.mouseY > j2 - 12 && super.mouseY < j2 + 4
					&& super.mouseX < (l1 - 3) + gv) {
				k2 = 0xffff00;
			}
			gameGraphics.drawString(menuText1[tv[j1]] + " " + menuText2[tv[j1]], l1,
					j2, 1, k2);
		}

	}

	public void fm() {
		if (lcb >= 0 || selectedItem >= 0) {
			menuText1[menuLength] = "Cancel";
			menuText2[menuLength] = "";
			menuID[menuLength] = 4000;
			menuLength++;
		}
		for (int i1 = 0; i1 < menuLength; i1++) {
			tv[i1] = i1;
		}

		for (boolean flag = false; !flag;) {
			flag = true;
			for (int j1 = 0; j1 < menuLength - 1; j1++) {
				int l1 = tv[j1];
				int j2 = tv[j1 + 1];
				if (menuID[l1] > menuID[j2]) {
					tv[j1] = j2;
					tv[j1 + 1] = l1;
					flag = false;
				}
			}

		}

		if (menuLength > 20) {
			menuLength = 20;
		}
		if (menuLength > 0) {
			int k1 = -1;
			for (int i2 = 0; i2 < menuLength; i2++) {
				if (menuText2[tv[i2]] == null
						|| menuText2[tv[i2]].length() <= 0) {
					continue;
				}
				k1 = i2;
				break;
			}

			String s = null;
			if ((selectedItem >= 0 || lcb >= 0) && menuLength == 1) {
				s = "Choose a target";
			} else if ((selectedItem >= 0 || lcb >= 0) && menuLength > 1) {
				s = "@whi@" + menuText1[tv[0]] + " " + menuText2[tv[0]];
			} else if (k1 != -1) {
				s = menuText2[tv[k1]] + ": @whi@" + menuText1[tv[0]];
			}
			if (menuLength == 2 && s != null) {
				s = s + "@whi@ / 1 more option";
			}
			if (menuLength > 2 && s != null) {
				s = s + "@whi@ / " + (menuLength - 1) + " more options";
			}
			if (s != null) {
				gameGraphics.drawString(s, 6, 14, 1, 0xffff00);
			}
			if (!mouseButtons && mx == 1 || mouseButtons && mx == 1
					&& menuLength == 1) {
				jl(tv[0]);
				mx = 0;
				return;
			}
			if (!mouseButtons && mx == 2 || mouseButtons && mx == 1) {
				hv = (menuLength + 1) * 15;
				gv = gameGraphics.textWidth("Choose option", 1) + 5;
				for (int k2 = 0; k2 < menuLength; k2++) {
					int l2 = gameGraphics.textWidth(menuText1[k2] + " "
							+ menuText2[k2], 1) + 5;
					if (l2 > gv) {
						gv = l2;
					}
				}

				ev = super.mouseX - gv / 2;
				fv = super.mouseY - 7;
				dv = true;
				if (ev < 0) {
					ev = 0;
				}
				if (fv < 0) {
					fv = 0;
				}
				if (ev + gv > 510) {
					ev = 510 - gv;
				}
				if (fv + hv > 315) {
					fv = 315 - hv;
				}
				mx = 0;
			}
		}
	}

	public void jl(int arg0) {
		int i1 = menuActionX[arg0];
		int j1 = menuActionY[arg0];
		int actionType = menuActionType[arg0];
		int l1 = menuActionVariable[arg0];
		int i2 = sv[arg0];
		int currentMenuID = menuID[arg0];
		if (currentMenuID == 200) {
			gl(sectionX, sectionY, i1, j1, true);
			super.streamClass.createPacket(224);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 210) {
			gl(sectionX, sectionY, i1, j1, true);
			super.streamClass.createPacket(250);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			selectedItem = -1;
		}
		if (currentMenuID == 220) {
			gl(sectionX, sectionY, i1, j1, true);
			super.streamClass.createPacket(252);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 3200) {
			displayMessage(Cache.itemExamine[actionType], 3);
		}
		if (currentMenuID == 300) {
			walkToAction(i1, j1, actionType);
			super.streamClass.createPacket(223);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.addByte(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 310) {
			walkToAction(i1, j1, actionType);
			super.streamClass.createPacket(239);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.addByte(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			selectedItem = -1;
		}
		if (currentMenuID == 320) {
			walkToAction(i1, j1, actionType);
			super.streamClass.createPacket(238);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.addByte(actionType);
			sendPacket();
		}
		if (currentMenuID == 2300) {
			walkToAction(i1, j1, actionType);
			super.streamClass.createPacket(229);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.addByte(actionType);
			sendPacket();
		}
		if (currentMenuID == 3300) {
			displayMessage(Cache.nib[actionType], 3);
		}
		if (currentMenuID == 400) {
			walkToObject(i1, j1, actionType, l1);
			super.streamClass.createPacket(222);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.add2ByteInt(i2);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 410) {
			walkToObject(i1, j1, actionType, l1);
			super.streamClass.createPacket(241);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.add2ByteInt(i2);
			sendPacket();
			selectedItem = -1;
		}
		if (currentMenuID == 420) {
			walkToObject(i1, j1, actionType, l1);
			super.streamClass.createPacket(242);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			sendPacket();
		}
		if (currentMenuID == 2400) {
			walkToObject(i1, j1, actionType, l1);
			super.streamClass.createPacket(230);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			sendPacket();
		}
		if (currentMenuID == 3400) {
			displayMessage(Cache.description[actionType], 3);
		}
		if (currentMenuID == 600) {
			super.streamClass.createPacket(220);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 610) {
			super.streamClass.createPacket(240);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			selectedItem = -1;
		}
		if (currentMenuID == 620) {
			super.streamClass.createPacket(248);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 630) {
			super.streamClass.createPacket(249);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 640) {
			super.streamClass.createPacket(246);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 650) {
			selectedItem = actionType;
			nx = 0;
			tx = Cache.itemNames[inventoryItems[selectedItem]][0];
		}
		if (currentMenuID == 660) {
			super.streamClass.createPacket(251);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
			selectedItem = -1;
			nx = 0;
			displayMessage("Dropping "
					+ Cache.itemNames[inventoryItems[actionType]][0], 4);
		}
		if (currentMenuID == 3600) {
			displayMessage(Cache.itemExamine[actionType], 3);
		}
		if (currentMenuID == 700) {
			int k2 = (i1 - 64) / magicLoc;
			int j4 = (j1 - 64) / magicLoc;
			ul(sectionX, sectionY, k2, j4, true);
			super.streamClass.createPacket(225);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 710) {
			int l2 = (i1 - 64) / magicLoc;
			int k4 = (j1 - 64) / magicLoc;
			ul(sectionX, sectionY, l2, k4, true);
			super.streamClass.createPacket(243);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			selectedItem = -1;
		}
		if (currentMenuID == 720) {
			int i3 = (i1 - 64) / magicLoc;
			int l4 = (j1 - 64) / magicLoc;
			ul(sectionX, sectionY, i3, l4, true);
			super.streamClass.createPacket(245);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 715 || currentMenuID == 2715) {
			int j3 = (i1 - 64) / magicLoc;
			int i5 = (j1 - 64) / magicLoc;
			ul(sectionX, sectionY, j3, i5, true);
			super.streamClass.createPacket(244);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 3700) {
			displayMessage(Cache.npcName[actionType], 3);
		}
		if (currentMenuID == 800) {
			int k3 = (i1 - 64) / magicLoc;
			int j5 = (j1 - 64) / magicLoc;
			ul(sectionX, sectionY, k3, j5, true);
			super.streamClass.createPacket(226);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 810) {
			int l3 = (i1 - 64) / magicLoc;
			int k5 = (j1 - 64) / magicLoc;
			ul(sectionX, sectionY, l3, k5, true);
			super.streamClass.createPacket(219);
			super.streamClass.add2ByteInt(actionType);
			super.streamClass.add2ByteInt(l1);
			sendPacket();
			selectedItem = -1;
		}
		if (currentMenuID == 805 || currentMenuID == 2805) {
			int i4 = (i1 - 64) / magicLoc;
			int l5 = (j1 - 64) / magicLoc;
			ul(sectionX, sectionY, i4, l5, true);
			super.streamClass.createPacket(228);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 2810) {
			super.streamClass.createPacket(235);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 2820) {
			super.streamClass.createPacket(214);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
		}
		if (currentMenuID == 900) {
			ul(sectionX, sectionY, i1, j1, true);
			super.streamClass.createPacket(221);
			super.streamClass.add2ByteInt(i1 + areaX);
			super.streamClass.add2ByteInt(j1 + areaY);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 920) {
			ul(sectionX, sectionY, i1, j1, false);
			if (actionPictureType == -24) {
				actionPictureType = 24;
			}
		}
		if (currentMenuID == 1000) {
			super.streamClass.createPacket(227);
			super.streamClass.add2ByteInt(actionType);
			sendPacket();
			lcb = -1;
		}
		if (currentMenuID == 4000) {
			selectedItem = -1;
			lcb = -1;
		}
	}

	public mudclient() {
		lastPlayerArray = new Mob[500];
		zs = false;
		bt = false;
		cameraAngleMode = true;
		playerKiller = false;
		it = "";
		kt = false;
		error = false;
		magicLoc = 128;
		appletMode = true;
		cameraRotation = 128;
		windowWidth = 512;
		windowHeight = 334;
		du = 9;
		gu = 0xbc614e;
		hu = false;
		cameraHeight = 550;
		zoomCamera = false;
		cameraAutoAngle = 1;
		lastWildyYSubtract = -1;
		wildYSubtract = -1;
		dv = false;
		jv = 200;
		mouseButtons = false;
		menuText2 = new String[jv];
		menuText1 = new String[jv];
		menuID = new int[jv];
		menuActionX = new int[jv];
		menuActionY = new int[jv];
		menuActionType = new int[jv];
		menuActionVariable = new int[jv];
		sv = new int[jv];
		tv = new int[jv];
		uv = 4000;
		vv = 500;
		mobArray = new Mob[uv];
		playerArray = new Mob[vv];
		ourPlayer = new Mob();
		dw = 1000;
		ew = 500;
		npcRecordArray = new Mob[dw];
		npcArray = new Mob[ew];
		lw = 500;
		groundItemX = new int[lw];
		groundItemY = new int[lw];
		groundItemType = new int[lw];
		groundItemObjectVar = new int[lw];
		sw = 1500;
		objectModelArray = new Model[sw];
		objectX = new int[sw];
		objectY = new int[sw];
		objectType = new int[sw];
		objectID = new int[sw];
		gameDataModels = new Model[200];
		ax = new boolean[sw];
		bx = 500;
		doorModel = new Model[bx];
		doorX = new int[bx];
		doorY = new int[bx];
		doorDirection = new int[bx];
		doorType = new int[bx];
		ix = new boolean[bx];
		jx = 8000;
		sectionXArray = new int[jx];
		sectionYArray = new int[jx];
		inventoryItems = new int[30];
		inventoryItemsCount = new int[30];
		wearing = new int[30];
		selectedItem = -1;
		tx = "";
		showTradeWindow = false;
		tradeOtherPlayerName = "";
		offeredItemID = new int[14];
		offeredItemAmount = new int[14];
		tradeOtherItems = new int[14];
		tradeOtherAmount = new int[14];
		tradeOtherAccepted = false;
		tradeWeAccepted = false;
		showShopWindow = false;
		shopItemIDs = new int[256];
		shopItemAmounts = new int[256];
		ly = new int[256];
		my = -1;
		ny = -2;
		playerStatCurrent = new int[16];
		playerStatBase = new int[16];
		equipmentStatus = new int[5];
		mobArrayIndexes = new int[500];
		showQuestionMenu = false;
		questionMenuAnswer = new String[5];
		cz = "";
		dz = "";
		ez = "";
		fz = "";
		qz = 5;
		rz = new String[qz];
		sz = new int[qz];
		uz = 40;
		showCharacterLookScreen = false;
		ubb = 1;
		vbb = 2;
		wbb = 2;
		xbb = 8;
		ybb = 14;
		acb = 1;
		lcb = -1;
		qcb = -1;
		rcb = -1;
		wcb = new String[50];
		xcb = new int[50];
		ycb = new int[50];
		mobMessagesWidth = new int[50];
		adb = new int[50];
		cdb = new int[50];
		ddb = new int[50];
		edb = new int[50];
		fdb = new int[50];
		hdb = new int[50];
		idb = new int[50];
		jdb = new int[50];
	}

	boolean zs;
	int at;
	boolean bt;
	boolean cameraAngleMode;
	boolean playerKiller;
	int pvpChangeAvaible;
	int ft;
	int gt;
	int ht;
	String it;
	int jt;
	boolean kt;
	int lastDeath;
	int mt;
	boolean error;
	Graphics ot;
	Camera gameCamera;
	GameImageMiddleMan gameGraphics;
	Image rt;
	int st;
	int magicLoc;
	int loggedIn;
	int walkModel[] = { 0, 1, 2, 1 };
	int npcCombatModelArray1[] = { 0, 1, 2, 1, 0, 0, 0, 0 };
	int npcCombatModelArray2[] = { 0, 0, 0, 0, 0, 1, 2, 1 };
	public boolean appletMode;
	public int cameraRotation;
	public int au;
	int windowWidth;
	int windowHeight;
	int du;
	int loginTimer;
	int playerAliveTimeout;
	int gu;
	boolean hu;
	int iu;
	int ju;
	int ku;
	int cameraHeight;
	boolean zoomCamera;
	int nu;
	int ou;
	int cameraAutoAngle;
	int qu;
	int wildX;
	int wildY;
	int wildYMultipler;
	int lastWildyYSubtract;
	int areaX;
	int areaY;
	int wildYSubtract;
	int yu;
	int zu;
	int av;
	int bv;
	Terrain terrain;
	boolean dv;
	int ev;
	int fv;
	int gv;
	int hv;
	int menuLength;
	int jv;
	boolean mouseButtons;
	String menuText2[];
	String menuText1[];
	int menuID[];
	int menuActionX[];
	int menuActionY[];
	int menuActionType[];
	int menuActionVariable[];
	int sv[];
	int tv[];
	int uv;
	int vv;
	int playerCount;
	int fightCount;
	Mob mobArray[];
	Mob playerArray[];
	Mob ourPlayer;
	int sectionX;
	int sectionY;
	int dw;
	int ew;
	int npcCount;
	Mob npcRecordArray[];
	Mob npcArray[];
	int iw;
	int jw;
	int npcAnimationArray[][] = { { 11, 2, 9, 7, 1, 6, 10, 0, 5, 8, 3, 4 },
			{ 11, 2, 9, 7, 1, 6, 10, 0, 5, 8, 3, 4 },
			{ 11, 3, 2, 9, 7, 1, 6, 10, 0, 5, 8, 4 },
			{ 3, 4, 2, 9, 7, 1, 6, 10, 8, 11, 0, 5 },
			{ 3, 4, 2, 9, 7, 1, 6, 10, 8, 11, 0, 5 },
			{ 4, 3, 2, 9, 7, 1, 6, 10, 8, 11, 0, 5 },
			{ 11, 4, 2, 9, 7, 1, 6, 10, 0, 5, 8, 3 },
			{ 11, 2, 9, 7, 1, 6, 10, 0, 5, 8, 4, 3 } };
	int lw;
	int groundItemCount;
	int nw;
	int groundItemX[];
	int groundItemY[];
	int groundItemType[];
	int groundItemObjectVar[];
	int sw;
	int objectCount;
	Model objectModelArray[];
	int objectX[];
	int objectY[];
	int objectType[];
	int objectID[];
	Model gameDataModels[];
	boolean ax[];
	int bx;
	int doorCount;
	Model doorModel[];
	int doorX[];
	int doorY[];
	int doorDirection[];
	int doorType[];
	boolean ix[];
	int jx;
	int sectionXArray[];
	int sectionYArray[];
	int mx;
	int nx;
	int inventoryCount;
	int inventoryItems[];
	int inventoryItemsCount[];
	int wearing[];
	int selectedItem;
	String tx;
	boolean showTradeWindow;
	String tradeOtherPlayerName;
	int tradeMyItemCount;
	int offeredItemID[];
	int offeredItemAmount[];
	int tradeOtherItemCount;
	int tradeOtherItems[];
	int tradeOtherAmount[];
	boolean tradeOtherAccepted;
	boolean tradeWeAccepted;
	int ey;
	int fy;
	boolean showShopWindow;
	int shopSellModifier;
	int showBuyModifier;
	int shopItemIDs[];
	int shopItemAmounts[];
	int ly[];
	int my;
	int ny;
	int playerStatCurrent[];
	int playerStatBase[];
	int equipmentStatus[];
	int questPoints;
	String skillArray[] = { "Attack", "Defense", "Strength", "Hits", "Ranged",
			"Prayer", "Magic", "Cooking", "Woodcutting", "Fletching",
			"Fishing", "Firemaking", "Crafting", "Smithing", "Mining",
			"Herblaw" };
	String ty[] = { "Armour", "WeaponAim", "WeaponPower", "Magic", "Prayer" };
	int uy;
	int mobArrayIndexes[];
	boolean showQuestionMenu;
	int questionMenuCount;
	String questionMenuAnswer[];
	int zy;
	int az;
	int bz;
	String cz;
	String dz;
	String ez;
	String fz;
	int gz;
	int hz;
	int iz;
	int jz;
	Menu gameMenu;
	int lz;
	int chatHandle;
	int nz;
	int oz;
	int pz;
	int qz;
	String rz[];
	int sz[];
	int combatStyle;
	int uz;
	int vz;
	Menu registerMenu;
	Menu welcomeMenu;
	Menu loginMenu;
	Menu characterDesignMenu;
	Menu agreementMenu;
	int bab;
	int cab;
	int dab;
	int eab;
	int fab;
	int gab;
	int hab;
	int iab;
	int jab;
	int kab;
	int lab;
	int mab;
	int nab;
	int oab;
	int pab;
	int qab;
	int rab;
	int sab;
	int tab;
	int uab;
	int vab;
	int wab;
	int xab;
	int yab;
	int zab;
	int abb;
	int bbb;
	int cbb;
	int dbb;
	int ebb;
	int fbb;
	int gbb;
	int hbb;
	int ibb;
	int jbb;
	int kbb;
	int lbb;
	int mbb;
	int nbb;
	int obb;
	int pbb;
	int qbb;
	int rbb;
	boolean showCharacterLookScreen;
	int tbb;
	int ubb;
	int vbb;
	int wbb;
	int xbb;
	int ybb;
	int zbb;
	int acb;
	public int bcb[] = { 0xff0000, 0xff8000, 0xffe000, 0xa0e000, 57344, 32768,
			41088, 45311, 33023, 12528, 0xe000e0, 0x303030, 0x604000, 0x805000,
			0xffffff };
	public int ccb[] = { 0xffc030, 0xffa040, 0x805030, 0x604020, 0x303030,
			0xff6020, 0xff4000, 0xffffff, 65280, 65535 };
	public int dcb[] = { 0xecded0, 0xccb366, 0xb38c40, 0x997326, 0x906020 };
	Menu ecb;
	int fcb;
	int gcb;
	Menu hcb;
	int icb;
	int jcb;
	long kcb;
	int lcb;
	String mcb;
	int modelUpdatingTimer;
	int ocb;
	int pcb;
	int qcb;
	int rcb;
	int actionPictureType;
	int tcb;
	int ucb;
	int mobMessageCount;
	String wcb[];
	int xcb[];
	int ycb[];
	int mobMessagesWidth[];
	int adb[];
	int bdb;
	int cdb[];
	int ddb[];
	int edb[];
	int fdb[];
	int gdb;
	int hdb[];
	int idb[];
	int jdb[];
	int serverIndex;
}
